summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/apps/passwd.c
diff options
context:
space:
mode:
authorsimon <simon@FreeBSD.org>2006-07-29 19:10:21 +0000
committersimon <simon@FreeBSD.org>2006-07-29 19:10:21 +0000
commitfb3c70eda88d3175627edc6a3316b4508b3d29c5 (patch)
tree213a0c4d5ba3869f66ecf970819532048fed4a9d /crypto/openssl/apps/passwd.c
parent3c8d7d9993705e30bc69e55cd19d8a298e582292 (diff)
downloadFreeBSD-src-fb3c70eda88d3175627edc6a3316b4508b3d29c5.zip
FreeBSD-src-fb3c70eda88d3175627edc6a3316b4508b3d29c5.tar.gz
Vendor import of OpenSSL 0.9.8b
Diffstat (limited to 'crypto/openssl/apps/passwd.c')
-rw-r--r--crypto/openssl/apps/passwd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/openssl/apps/passwd.c b/crypto/openssl/apps/passwd.c
index 3ad91d8..9ca25dd 100644
--- a/crypto/openssl/apps/passwd.c
+++ b/crypto/openssl/apps/passwd.c
@@ -312,7 +312,8 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
static char out_buf[6 + 9 + 24 + 2]; /* "$apr1$..salt..$.......md5hash..........\0" */
unsigned char buf[MD5_DIGEST_LENGTH];
char *salt_out;
- int n, i;
+ int n;
+ unsigned int i;
EVP_MD_CTX md,md2;
size_t passwd_len, salt_len;
@@ -358,13 +359,13 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
for (i = 0; i < 1000; i++)
{
EVP_DigestInit_ex(&md2,EVP_md5(), NULL);
- EVP_DigestUpdate(&md2, (i & 1) ? (unsigned char *) passwd : buf,
+ EVP_DigestUpdate(&md2, (i & 1) ? (unsigned const char *) passwd : buf,
(i & 1) ? passwd_len : sizeof buf);
if (i % 3)
EVP_DigestUpdate(&md2, salt_out, salt_len);
if (i % 7)
EVP_DigestUpdate(&md2, passwd, passwd_len);
- EVP_DigestUpdate(&md2, (i & 1) ? buf : (unsigned char *) passwd,
+ EVP_DigestUpdate(&md2, (i & 1) ? buf : (unsigned const char *) passwd,
(i & 1) ? sizeof buf : passwd_len);
EVP_DigestFinal_ex(&md2, buf, NULL);
}
@@ -473,7 +474,8 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
if ((strlen(passwd) > pw_maxlen))
{
if (!quiet)
- BIO_printf(bio_err, "Warning: truncating password to %u characters\n", pw_maxlen);
+ /* XXX: really we should know how to print a size_t, not cast it */
+ BIO_printf(bio_err, "Warning: truncating password to %u characters\n", (unsigned)pw_maxlen);
passwd[pw_maxlen] = 0;
}
assert(strlen(passwd) <= pw_maxlen);
OpenPOWER on IntegriCloud