| 1077 | } |
| 1078 | |
| 1079 | static const char *sha1_func(ap_expr_eval_ctx_t *ctx, const void *data, |
| 1080 | const char *arg) |
| 1081 | { |
| 1082 | apr_sha1_ctx_t context; |
| 1083 | apr_byte_t sha1[APR_SHA1_DIGESTSIZE]; |
| 1084 | char *out; |
| 1085 | |
| 1086 | out = apr_palloc(ctx->p, APR_SHA1_DIGESTSIZE*2+1); |
| 1087 | |
| 1088 | apr_sha1_init(&context); |
| 1089 | apr_sha1_update(&context, arg, (unsigned int)strlen(arg)); |
| 1090 | apr_sha1_final(sha1, &context); |
| 1091 | |
| 1092 | ap_bin2hex(sha1, APR_SHA1_DIGESTSIZE, out); |
| 1093 | |
| 1094 | return out; |
| 1095 | } |
| 1096 | |
| 1097 | static const char *md5_func(ap_expr_eval_ctx_t *ctx, const void *data, |
| 1098 | const char *arg) |
nothing calls this directly
no test coverage detected