Fixes for building AES key wrap and PKCS7 on Windows. Cleanup snprintf to use XSNPRINTF and changed so define is always setup.

This commit is contained in:
David Garske
2017-05-18 14:44:19 -07:00
parent 4370a01778
commit d61e0243a3
5 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -4963,8 +4963,6 @@ int wc_AesKeyWrap(const byte* key, word32 keySz, const byte* in, word32 inSz,
int wc_AesKeyUnWrap(const byte* key, word32 keySz, const byte* in, word32 inSz,
byte* out, word32 outSz, const byte* iv)
{
(void)iv;
Aes aes;
byte* r;
word32 i, n;
@@ -4978,6 +4976,8 @@ int wc_AesKeyUnWrap(const byte* key, word32 keySz, const byte* in, word32 inSz,
0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6
};
(void)iv;
if (key == NULL || in == NULL || inSz < 3 ||
out == NULL || outSz < (inSz - KEYWRAP_BLOCK_SIZE))
return BAD_FUNC_ARG;
Regular → Executable
+1 -1
View File
@@ -946,7 +946,7 @@ int wc_PKCS7_EncodeSignedData(PKCS7* pkcs7, byte* output, word32 outputSz)
return ret;
}
esd->contentDigest[0] = ASN_OCTET_STRING;
esd->contentDigest[1] = hashSz;
esd->contentDigest[1] = (byte)hashSz;
ret = wc_HashFinal(&esd->hash, esd->hashType,
&esd->contentDigest[2]);
if (ret < 0) {