From 27b2336029335ea3f02243ff170986cdab1f98ef Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 11 Mar 2015 17:53:04 +0100 Subject: 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 Signed-off-by: Sascha Hauer --- common/password.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/password.c') 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)); -- cgit v1.2.3