boringssl/crypto/evp
David Benjamin 42329a828b Clean up PKCS5_PBKDF2_HMAC.
This was a mess. HMAC_CTX_copy_ex would avoid having to cleanup and init
the HMAC_CTX repeatedly, but even that is unnecessary. hctx_tpl was just
to reuse the key. Instead, HMAC_CTX already can be reset with the same
key. (Alas, with a slightly odd API, but so it goes.) Do that, and use
goto err to cleanup the error-handling.

Thanks to upstream's b98530d6e09f4cb34c791b8840e936c1fc1467cf for
drawing attention to this. (Though we've diverged significantly from
upstream with all the heap-allocated bits, so I didn't use the change
itself.)

While I'm here, tidy up some variable names and cite the newer RFC.

Change-Id: Ic1259f46b7c5a14dc341b8cee385be5508ac4daf
Reviewed-on: https://boringssl-review.googlesource.com/14605
Reviewed-by: Steven Valdez <svaldez@google.com>
Commit-Queue: Steven Valdez <svaldez@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2017-04-04 18:13:53 +00:00
..
CMakeLists.txt Convert evp_extra_test into GTest. 2017-03-01 18:32:29 +00:00
digestsign.c Don't default to SHA-1 in |EVP_DigestSignInit|/|EVP_DigestVerifyInit|. 2015-10-26 21:26:51 +00:00
evp_asn1.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
evp_ctx.c Tidy up EVP_PKEY_CTX_dup and fix malloc error crash. 2017-02-16 23:24:53 +00:00
evp_extra_test.cc Convert evp_extra_test into GTest. 2017-03-01 18:32:29 +00:00
evp_test.cc Improve RSA-PSS test coverage around length bounds. 2017-03-21 16:15:32 +00:00
evp_tests.txt Add some PSS test vectors with non-zero salt length. 2017-03-22 17:53:10 +00:00
evp.c Unwind the rest of EVP_PKEY_supports_digest. 2017-03-30 16:28:25 +00:00
internal.h Unwind the rest of EVP_PKEY_supports_digest. 2017-03-30 16:28:25 +00:00
p_dsa_asn1.c Unwind the rest of EVP_PKEY_supports_digest. 2017-03-30 16:28:25 +00:00
p_ec_asn1.c Unwind the rest of EVP_PKEY_supports_digest. 2017-03-30 16:28:25 +00:00
p_ec.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
p_rsa_asn1.c Unwind the rest of EVP_PKEY_supports_digest. 2017-03-30 16:28:25 +00:00
p_rsa.c Convert more RSA padding check functions to size_t. 2017-03-30 16:19:45 +00:00
pbkdf_test.cc Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
pbkdf.c Clean up PKCS5_PBKDF2_HMAC. 2017-04-04 18:13:53 +00:00
print.c Use C99 for size_t loops. 2016-09-12 19:44:24 +00:00
sign.c Take advantage of normalized return values. 2015-03-13 19:40:42 +00:00