diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2015-03-11 17:53:04 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-12 07:58:24 +0100 |
commit | 27b2336029335ea3f02243ff170986cdab1f98ef (patch) | |
tree | 722083808d1ce9b3bb69d3cca3520ce61a09064d /common/password.c | |
parent | 804fae5d16c8c48c6fca8d54f2878a2e382a0bc2 (diff) | |
download | barebox-27b2336029335ea3f02243ff170986cdab1f98ef.tar.gz barebox-27b2336029335ea3f02243ff170986cdab1f98ef.tar.xz |
digest: make it multi-instance
Now you need to call digest_alloc and when you finish to use it digest_free.
We need this for upcomming aes encryption support and secure boot
as we will need multiple instance of the same digest.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/password.c')
-rw-r--r-- | common/password.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/password.c b/common/password.c index 16061095a8..4c33152dbe 100644 --- a/common/password.c +++ b/common/password.c @@ -280,7 +280,7 @@ static int __check_passwd(unsigned char* passwd, size_t length, int std) unsigned char *passwd2_sum; int ret = 0; - d = digest_get_by_name(PASSWD_SUM); + d = digest_alloc(PASSWD_SUM); passwd1_sum = calloc(digest_length(d), sizeof(unsigned char)); @@ -315,6 +315,7 @@ err2: free(passwd2_sum); err1: free(passwd1_sum); + digest_free(d); return ret; } @@ -347,7 +348,7 @@ int set_env_passwd(unsigned char* passwd, size_t length) unsigned char *passwd_sum; int ret; - d = digest_get_by_name(PASSWD_SUM); + d = digest_alloc(PASSWD_SUM); passwd_sum = calloc(digest_length(d), sizeof(unsigned char)); |