X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fsec%2Futil.c;h=7af6cdbe8dd2823c5545f3029d28a32a98f20964;hb=7c66ae1b30f81fd138f9f4b6ad49ac4d527af642;hp=b5982b383270d8a0af474c1a000a407f3b0bc23f;hpb=aa13bdb17609cccbd47c29103847d813015ffbd6;p=bertos.git diff --git a/bertos/sec/util.c b/bertos/sec/util.c index b5982b38..7af6cdbe 100644 --- a/bertos/sec/util.c +++ b/bertos/sec/util.c @@ -32,7 +32,7 @@ * * \brief Generic utilities. * \author Giovanni Bajo - * + * */ #include "util.h" @@ -48,10 +48,10 @@ void password2key(const char *pwd, size_t pwd_len, uint8_t *key, size_t key_len) { - Kdf *kdf = PBKDF2_stackinit(HMAC_stackinit(SHA1_stackinit())); - + Kdf *kdf = PBKDF2_stackinit(hmac_stackinit(SHA1_stackinit())); + kdf_begin(kdf, pwd, pwd_len, (uint8_t*)SALT, sizeof(SALT)); kdf_read(kdf, key, key_len); - + // FIXME: how to purge the stack? }