aboutsummaryrefslogtreecommitdiff
path: root/pbkdf2.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2016-08-10 17:48:40 -0400
committerPaul Selkirk <paul@psgd.org>2016-08-10 17:49:02 -0400
commitf5a63c380d9091b002949624001b2b1426454b56 (patch)
tree341e4c50b139559abf8cd230c4e2463fe48a8b05 /pbkdf2.c
parent9960e43c1a6b7f83b4a345acedbda56fbeaaae0c (diff)
parent30f8e4e85b6a337291b09d55d8edc15e422b6341 (diff)
Merge branch 'resource_management'
Diffstat (limited to 'pbkdf2.c')
-rw-r--r--pbkdf2.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/pbkdf2.c b/pbkdf2.c
index c696f2f..4395941 100644
--- a/pbkdf2.c
+++ b/pbkdf2.c
@@ -46,7 +46,7 @@
* if and when we get clever about reusing HMAC state for speed.
*/
-static hal_error_t do_hmac(const hal_core_t *core,
+static hal_error_t do_hmac(hal_core_t *core,
const hal_hash_descriptor_t * const d,
const uint8_t * const pw, const size_t pw_len,
const uint8_t * const data, const size_t data_len,
@@ -78,7 +78,7 @@ static hal_error_t do_hmac(const hal_core_t *core,
* Derive a key from a passphrase using the PBKDF2 algorithm.
*/
-hal_error_t hal_pbkdf2(const hal_core_t *core,
+hal_error_t hal_pbkdf2(hal_core_t *core,
const hal_hash_descriptor_t * const descriptor,
const uint8_t * const password, const size_t password_length,
const uint8_t * const salt, const size_t salt_length,
@@ -117,6 +117,13 @@ hal_error_t hal_pbkdf2(const hal_core_t *core,
memset(result, 0, sizeof(result));
memset(mac, 0, sizeof(mac));
+#if 1
+ /* HACK - find the second sha256 core, to avoid interfering with rpc.
+ */
+ core = hal_core_find(descriptor->core_name, NULL);
+ core = hal_core_find(descriptor->core_name, core);
+#endif
+
/*
* We probably should check here to see whether the password is
* longer than the HMAC block size, and, if so, we should hash the