From d779f2e6cad64e502742c1b033d005b70d8f90ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20T=C3=B6rnblom?= Date: Tue, 4 Sep 2012 10:47:24 +0200 Subject: [PATCH] Make sure we use SHA1 and not SHA0. fixes compiling error when SHA0 is disabled in openssl. --- src/access.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/access.c b/src/access.c index b8c73f90..7814025e 100644 --- a/src/access.c +++ b/src/access.c @@ -210,11 +210,11 @@ access_get_hashed(const char *username, const uint8_t digest[20], if(superuser_username != NULL && superuser_password != NULL) { - SHA_Init(&shactx); - SHA_Update(&shactx, (const uint8_t *)superuser_password, - strlen(superuser_password)); - SHA_Update(&shactx, challenge, 32); - SHA_Final(d, &shactx); + SHA1_Init(&shactx); + SHA1_Update(&shactx, (const uint8_t *)superuser_password, + strlen(superuser_password)); + SHA1_Update(&shactx, challenge, 32); + SHA1_Final(d, &shactx); if(!strcmp(superuser_username, username) && !memcmp(d, digest, 20)) return 0xffffffff; @@ -229,9 +229,9 @@ access_get_hashed(const char *username, const uint8_t digest[20], if((b & ae->ae_netmask) != ae->ae_network) continue; /* IP based access mismatches */ - SHA_Init(&shactx); - SHA_Update(&shactx, (const uint8_t *)ae->ae_password, - strlen(ae->ae_password)); + SHA1_Init(&shactx); + SHA1_Update(&shactx, (const uint8_t *)ae->ae_password, + strlen(ae->ae_password)); SHA1_Update(&shactx, challenge, 32); SHA1_Final(d, &shactx);