boringssl/crypto
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
..
aes Synchronize bsaes-armv7.pl with upstream. 2017-03-27 16:38:33 +00:00
asn1 Fix potential memory leak in ASN1_TIME_to_generalizedtime() 2017-03-21 18:10:51 +00:00
base64 Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
bio Convert bio_test to GTest. 2017-03-21 17:39:57 +00:00
bn Enable RSA AVX2 code. 2017-03-08 17:28:12 +00:00
buf Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
bytestring Correct a typo in ASN.1 type name. 2017-03-16 21:57:58 +00:00
chacha x86_64 assembly pack: Win64 SEH face-lift. 2017-02-16 21:55:04 +00:00
cipher Use a union in tls_cbc.c. 2017-03-30 16:25:11 +00:00
cmac Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
conf Fix out-of-memory condition in conf. 2017-03-21 16:19:22 +00:00
curve25519 Import additional test vectors from RFC 8032. 2017-03-30 16:28:55 +00:00
des Fix up macros. 2016-10-18 18:28:23 +00:00
dh Remove direct calls to BN_mod_exp. 2017-02-28 18:00:02 +00:00
digest Remove static output buffers for hash & HMAC functions. 2017-04-02 17:53:17 +00:00
dsa Add a common TestEventListener for the error queue. 2017-02-07 21:33:22 +00:00
ec Convert ec_test to GTest. 2017-02-16 23:33:48 +00:00
ecdh Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
ecdsa ECDSA: const EC_KEY* arguments where possible. 2017-02-18 06:22:01 +00:00
engine Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
err Prevent Channel ID and Custom Extensions on 0-RTT. 2017-03-26 18:13:57 +00:00
evp Clean up PKCS5_PBKDF2_HMAC. 2017-04-04 18:13:53 +00:00
hkdf Convert hkdf_test to C++. 2017-01-04 01:40:44 +00:00
hmac Remove static output buffers for hash & HMAC functions. 2017-04-02 17:53:17 +00:00
lhash Remove lh_new's default hash and comparator. 2017-01-04 01:44:10 +00:00
md4 Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
md5 Remove static output buffers for hash & HMAC functions. 2017-04-02 17:53:17 +00:00
modes Remove unsigned-based constant-time functions. 2017-03-30 16:24:19 +00:00
obj Reimplement objects.pl in Go. 2016-12-21 22:14:13 +00:00
pem Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
perlasm Gate assembly sources on !OPENSSL_NO_ASM. 2017-03-30 19:34:21 +00:00
pkcs8 Decouple PKCS8_encrypt and PKCS8_decrypt's core from crypto/asn1. 2017-03-26 04:00:26 +00:00
poly1305 Delete unused Poly1305 assembly. 2017-01-21 00:17:30 +00:00
pool Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
rand Remove TODO. 2017-03-25 16:29:04 +00:00
rc4 Simplify RC4 code and remove assembly. 2016-08-30 15:32:31 +00:00
rsa Unwind the rest of EVP_PKEY_supports_digest. 2017-03-30 16:28:25 +00:00
sha Remove static output buffers for hash & HMAC functions. 2017-04-02 17:53:17 +00:00
stack Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
test Convert bio_test to GTest. 2017-03-21 17:39:57 +00:00
x509 Remove some unnecessary NULL checks. 2017-03-26 18:58:17 +00:00
x509v3 Fix a crash in print_notice. 2017-03-21 14:50:26 +00:00
CMakeLists.txt Convert constant_time_test to GTest. 2017-03-26 19:04:07 +00:00
constant_time_test.cc Remove static output buffers for hash & HMAC functions. 2017-04-02 17:53:17 +00:00
cpu-aarch64-linux.c
cpu-arm-linux.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
cpu-arm.c
cpu-intel.c
cpu-ppc64le.c Add PPC64LE assembly for AES-GCM. 2016-09-27 18:43:20 +00:00
crypto.c Add PPC64LE assembly for AES-GCM. 2016-09-27 18:43:20 +00:00
ex_data.c Use C99 for size_t loops. 2016-09-12 19:44:24 +00:00
internal.h Remove unsigned-based constant-time functions. 2017-03-30 16:24:19 +00:00
mem.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
refcount_c11.c
refcount_lock.c
refcount_test.cc Convert constant_time_test and refcount_test to C++. 2017-01-04 01:36:49 +00:00
thread_none.c
thread_pthread.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
thread_test.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
thread_win.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
thread.c Remove a bunch of unnecessary includes. 2016-06-28 20:31:14 +00:00