projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add comments.
[bertos.git]
/
bertos
/
sec
/
util.c
diff --git
a/bertos/sec/util.c
b/bertos/sec/util.c
index b5982b383270d8a0af474c1a000a407f3b0bc23f..7af6cdbe8dd2823c5545f3029d28a32a98f20964 100644
(file)
--- a/
bertos/sec/util.c
+++ b/
bertos/sec/util.c
@@
-32,7
+32,7
@@
*
* \brief Generic utilities.
* \author Giovanni Bajo <rasky@develer.com>
*
* \brief Generic utilities.
* \author Giovanni Bajo <rasky@develer.com>
- *
+ *
*/
#include "util.h"
*/
#include "util.h"
@@
-48,10
+48,10
@@
void password2key(const char *pwd, size_t pwd_len,
uint8_t *key, size_t key_len)
{
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);
kdf_begin(kdf, pwd, pwd_len, (uint8_t*)SALT, sizeof(SALT));
kdf_read(kdf, key, key_len);
-
+
// FIXME: how to purge the stack?
}
// FIXME: how to purge the stack?
}