resolve windows warnings and add sanity check with PKCS12 parse

This commit is contained in:
Jacob Barthelmeh
2017-02-28 14:33:07 -07:00
parent b86dfd582f
commit f77458992e
4 changed files with 14 additions and 9 deletions

View File

@@ -830,15 +830,11 @@ int wc_HKDF(int type, const byte* inKey, word32 inKeySz,
saltSz = hashSz;
}
do {
ret = wc_HmacSetKey(&myHmac, type, localSalt, saltSz);
if (ret != 0)
break;
ret = wc_HmacUpdate(&myHmac, inKey, inKeySz);
if (ret != 0)
break;
ret = wc_HmacFinal(&myHmac, prk);
} while (0);
if (ret == 0)
ret = wc_HmacUpdate(&myHmac, inKey, inKeySz);
if (ret == 0)
ret = wc_HmacFinal(&myHmac, prk);
if (ret == 0) {
while (outIdx < outSz) {