Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 02BF7F6DC for ; Mon, 22 Apr 2013 14:09:07 +0000 (UTC) Received: (qmail 49236 invoked by uid 500); 22 Apr 2013 14:09:06 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 49113 invoked by uid 500); 22 Apr 2013 14:09:06 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 49106 invoked by uid 99); 22 Apr 2013 14:09:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Apr 2013 14:09:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Apr 2013 14:09:04 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 01997238899C; Mon, 22 Apr 2013 14:08:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1470524 - in /httpd/httpd/branches/2.4.x: ./ STATUS docs/manual/ docs/manual/expr.xml server/util_expr_eval.c Date: Mon, 22 Apr 2013 14:08:42 -0000 To: cvs@httpd.apache.org From: jim@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130422140843.01997238899C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jim Date: Mon Apr 22 14:08:42 2013 New Revision: 1470524 URL: http://svn.apache.org/r1470524 Log: Merge r1458004 from trunk: add md5 function, too Submitted by: sf Reviewed/backported by: jim Modified: httpd/httpd/branches/2.4.x/ (props changed) httpd/httpd/branches/2.4.x/STATUS httpd/httpd/branches/2.4.x/docs/manual/ (props changed) httpd/httpd/branches/2.4.x/docs/manual/expr.xml httpd/httpd/branches/2.4.x/server/util_expr_eval.c Propchange: httpd/httpd/branches/2.4.x/ ------------------------------------------------------------------------------ Merged /httpd/httpd/trunk:r1458004 Modified: httpd/httpd/branches/2.4.x/STATUS URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1470524&r1=1470523&r2=1470524&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/STATUS (original) +++ httpd/httpd/branches/2.4.x/STATUS Mon Apr 22 14:08:42 2013 @@ -90,12 +90,6 @@ RELEASE SHOWSTOPPERS: 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) Propchange: httpd/httpd/branches/2.4.x/docs/manual/ ------------------------------------------------------------------------------ Merged /httpd/httpd/trunk/docs/manual:r1458004 Modified: httpd/httpd/branches/2.4.x/docs/manual/expr.xml URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/expr.xml?rev=1470524&r1=1470523&r2=1470524&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/docs/manual/expr.xml (original) +++ httpd/httpd/branches/2.4.x/docs/manual/expr.xml Mon Apr 22 14:08:42 2013 @@ -464,6 +464,9 @@ listfunction ::= listfuncname "( unbase64 Decode base64 encoded string, return truncated string if 0x00 is found + md5 + Hash the string using MD5, then encode the hash with hexadecimal + encoding sha1 Hash the string using SHA1, then encode the hash with hexadecimal encoding Modified: httpd/httpd/branches/2.4.x/server/util_expr_eval.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/util_expr_eval.c?rev=1470524&r1=1470523&r2=1470524&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/server/util_expr_eval.c (original) +++ httpd/httpd/branches/2.4.x/server/util_expr_eval.c Mon Apr 22 14:08:42 2013 @@ -25,6 +25,7 @@ #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" @@ -1051,6 +1052,13 @@ static const char *sha1_func(ap_expr_eva 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) @@ -1610,6 +1618,7 @@ static const struct expr_provider_single { base64_func, "base64", NULL, 0 }, { unbase64_func, "unbase64", NULL, 0 }, { sha1_func, "sha1", NULL, 0 }, + { md5_func, "md5", NULL, 0 }, { NULL, NULL, NULL} };