Skip to content

Commit 9261231

Browse files
authored
Merge pull request #90 from cisco/revert-71-70-bigendian-fails
Revert "Fix: explicitly cast to uint32_t to mitigate endian-ness problems"
2 parents 579732b + 525e6f2 commit 9261231

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/concatkdf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static uint8_t *_apply_lendata(const uint8_t *data, const size_t len, uint8_t *b
3939
{
4040
uint8_t *ptr = buffer;
4141

42-
ptr =_apply_uint32((uint32_t)len, ptr);
42+
ptr =_apply_uint32(len, ptr);
4343
if (0 < len)
4444
{
4545
memcpy(ptr, data, len);
@@ -99,7 +99,7 @@ bool cjose_concatkdf_create_otherinfo(const char *alg,
9999
ptr = _apply_lendata((const uint8_t *)alg, algLen, ptr);
100100
ptr = _apply_lendata(apu, apuLen, ptr);
101101
ptr = _apply_lendata(apv, apvLen, ptr);
102-
ptr = _apply_uint32((uint32_t)keylen, ptr);
102+
ptr = _apply_uint32(keylen, ptr);
103103

104104
*otherinfoLen = bufferLen;
105105
*otherinfo = buffer;
@@ -141,7 +141,7 @@ uint8_t *cjose_concatkdf_derive(const size_t keylen,
141141
}
142142

143143
size_t offset = 0, amt = keylen;
144-
for (uint32_t idx = 1; N >= idx; idx++)
144+
for (int idx = 1; N >= idx; idx++)
145145
{
146146
uint8_t counter[4];
147147
_apply_uint32(idx, counter);

0 commit comments

Comments
 (0)