X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Fpasswd.c;h=a45245cd7ffb8f78cd1f37f13c371359676c012c;hb=a55b3959374161e33c68542d27c0fe93c6b7fe81;hp=3ae8f9647140ddcc2fe87737568aa69181de1efa;hpb=f6c460e8f69e90fdb87129bb70951ced89c7906f;p=oweals%2Fopenssl.git diff --git a/apps/passwd.c b/apps/passwd.c index 3ae8f96471..a45245cd7f 100644 --- a/apps/passwd.c +++ b/apps/passwd.c @@ -302,7 +302,7 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt) OPENSSL_strlcat(out_buf, "$", sizeof out_buf); OPENSSL_strlcat(out_buf, salt, sizeof out_buf); - if (strlen(out_buf) > 6 + 8); /* assert "$apr1$..salt.." */ + if (strlen(out_buf) > 6 + 8) /* assert "$apr1$..salt.." */ return NULL; salt_out = out_buf + 2 + magic_len; @@ -319,6 +319,7 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt) || !EVP_DigestUpdate(md, magic, magic_len) || !EVP_DigestUpdate(md, "$", 1) || !EVP_DigestUpdate(md, salt_out, salt_len)) + goto err; md2 = EVP_MD_CTX_new(); if (md2 == NULL @@ -496,10 +497,10 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p, BIO_printf(out, "%s\t%s\n", hash, passwd); else BIO_printf(out, "%s\n", hash); - return 0; + return 1; end: - return 1; + return 0; } #else