diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2000-08-06 06:07:33 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2000-08-06 06:07:33 +0000 |
commit | 06b2035cc7444370e4ad913f25e400545915a743 (patch) | |
tree | 4f0eea47f7ec42ad43d4b3fad7f7d5907e416115 /passwd | |
parent | 6105382e1c48011d628cd0562e87471ca605e8cb (diff) | |
download | libapr-06b2035cc7444370e4ad913f25e400545915a743.tar.gz |
Remaining cleanup of ap_ -> apr_ and AP_ -> APR_ transformation...
see src/lib/apr/apr_compat.h for most details.
Also a few minor nits to get Win32 to build.
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60481 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'passwd')
-rw-r--r-- | passwd/apr_md5.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index edea993d4..838b633a2 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -186,7 +186,7 @@ static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_MD5Encode() */ /* MD5 initialization. Begins an MD5 operation, writing a new context. */ -APR_EXPORT(apr_status_t) apr_MD5Init(ap_md5_ctx_t *context) +APR_EXPORT(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ @@ -205,14 +205,15 @@ APR_EXPORT(apr_status_t) apr_MD5Init(ap_md5_ctx_t *context) * to be used for translating the content before calculating the * digest. */ -APR_EXPORT(apr_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlate) +APR_EXPORT(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context, + apr_xlate_t *xlate) { apr_status_t rv; int is_sb; /* TODO: remove the single-byte-only restriction from this code */ - rv = ap_xlate_get_sb(xlate, &is_sb); + rv = apr_xlate_get_sb(xlate, &is_sb); if (rv != APR_SUCCESS) { return rv; } @@ -228,7 +229,7 @@ APR_EXPORT(apr_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlat operation, processing another message block, and updating the context. */ -APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, +APR_EXPORT(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) { @@ -241,7 +242,8 @@ APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, idx = (unsigned int) ((context->count[0] >> 3) & 0x3F); /* Update number of bits */ - if ((context->count[0] += ((UINT4) inputLen << 3)) < ((UINT4) inputLen << 3)) + if ((context->count[0] += ((UINT4) inputLen << 3)) + < ((UINT4) inputLen << 3)) context->count[1]++; context->count[1] += (UINT4) inputLen >> 29; @@ -267,7 +269,7 @@ APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, if (inputLen >= partLen) { if (context->xlate) { inbytes_left = outbytes_left = partLen; - ap_xlate_conv_buffer(context->xlate, input, &inbytes_left, + apr_xlate_conv_buffer(context->xlate, input, &inbytes_left, &context->buffer[idx],&outbytes_left); } else { @@ -279,7 +281,7 @@ APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, if (context->xlate) { unsigned char inp_tmp[64]; inbytes_left = outbytes_left = 64; - ap_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left, + apr_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left, inp_tmp, &outbytes_left); MD5Transform(context->state, inp_tmp); } @@ -296,7 +298,7 @@ APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, /* Buffer remaining input */ if (context->xlate) { inbytes_left = outbytes_left = inputLen - i; - ap_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left, + apr_xlate_conv_buffer(context->xlate, &input[i], &inbytes_left, &context->buffer[idx], &outbytes_left); } else { @@ -310,7 +312,7 @@ APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, the message digest and zeroizing the context. */ APR_EXPORT(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], - ap_md5_ctx_t *context) + apr_md5_ctx_t *context) { unsigned char bits[8]; unsigned int idx, padLen; @@ -459,7 +461,7 @@ static void Decode(UINT4 *output, const unsigned char *input, unsigned int len) } #ifdef CHARSET_EBCDIC -APR_EXPORT(apr_status_t) ap_MD5InitEBCDIC(apr_xlate_t *xlate) +APR_EXPORT(apr_status_t) apr_MD5InitEBCDIC(apr_xlate_t *xlate) { xlate_ebcdic_to_ascii = xlate; return APR_SUCCESS; @@ -502,7 +504,7 @@ APR_EXPORT(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, const char *sp, *ep; unsigned char final[MD5_DIGESTSIZE]; int sl, pl, i; - ap_md5_ctx_t ctx, ctx1; + apr_md5_ctx_t ctx, ctx1; unsigned long l; /* @@ -536,7 +538,7 @@ APR_EXPORT(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, */ apr_MD5Init(&ctx); #ifdef CHARSET_EBCDIC - ap_MD5SetXlate(&ctx, xlate_ebcdic_to_ascii); + apr_MD5SetXlate(&ctx, xlate_ebcdic_to_ascii); #endif /* @@ -563,7 +565,8 @@ APR_EXPORT(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); apr_MD5Final(final, &ctx1); for (pl = strlen(pw); pl > 0; pl -= MD5_DIGESTSIZE) { - apr_MD5Update(&ctx, final, (pl > MD5_DIGESTSIZE) ? MD5_DIGESTSIZE : pl); + apr_MD5Update(&ctx, final, + (pl > MD5_DIGESTSIZE) ? MD5_DIGESTSIZE : pl); } /* @@ -649,7 +652,8 @@ APR_EXPORT(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, * APR_EMISMATCH if they don't. */ -APR_EXPORT(apr_status_t) apr_validate_password(const char *passwd, const char *hash) +APR_EXPORT(apr_status_t) apr_validate_password(const char *passwd, + const char *hash) { char sample[120]; #if !defined(WIN32) && !defined(BEOS) |