PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * ap_expr: Expression parser: Add the ability to apply a md5 hash to
- strings within the parser.
- trunk patch: http://svn.apache.org/r1458004
- 2.4.x patch: trunk patch applies if previous proposals for ap_expr get applied.
- +1: rjung, minfrin, sf
-
* various: Use %pm available since apr 1.3 instead of an extra call to apr_strerror
trunk patches: https://svn.apache.org/r1463056
2.4.x patch: trunk patch works (with offset)
<tr><td><code>unbase64</code></td>
<td>Decode base64 encoded string, return truncated string if 0x00 is
found</td><td></td></tr>
+ <tr><td><code>md5</code></td>
+ <td>Hash the string using MD5, then encode the hash with hexadecimal
+ encoding</td><td></td></tr>
<tr><td><code>sha1</code></td>
<td>Hash the string using SHA1, then encode the hash with hexadecimal
encoding</td><td></td></tr>
#include "http_request.h"
#include "ap_provider.h"
#include "util_expr_private.h"
+#include "util_md5.h"
#include "apr_lib.h"
#include "apr_fnmatch.h"
return out;
}
+static const char *md5_func(ap_expr_eval_ctx_t *ctx, const void *data,
+ const char *arg)
+{
+ return ap_md5(ctx->p, (const unsigned char *)arg);
+}
+
+
#define MAX_FILE_SIZE 10*1024*1024
static const char *file_func(ap_expr_eval_ctx_t *ctx, const void *data,
char *arg)
{ base64_func, "base64", NULL, 0 },
{ unbase64_func, "unbase64", NULL, 0 },
{ sha1_func, "sha1", NULL, 0 },
+ { md5_func, "md5", NULL, 0 },
{ NULL, NULL, NULL}
};