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 976A6D1DF for ; Mon, 11 Mar 2013 16:34:40 +0000 (UTC) Received: (qmail 28688 invoked by uid 500); 11 Mar 2013 16:34:40 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 28642 invoked by uid 500); 11 Mar 2013 16:34:40 -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 28633 invoked by uid 99); 11 Mar 2013 16:34:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Mar 2013 16:34:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_FRT_SLUT 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, 11 Mar 2013 16:34:38 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9C03123889D7; Mon, 11 Mar 2013 16:34:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1455223 - in /httpd/httpd/branches/2.4.x: ./ STATUS modules/ssl/ssl_util_ssl.c Date: Mon, 11 Mar 2013 16:34:19 -0000 To: cvs@httpd.apache.org From: jim@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130311163419.9C03123889D7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jim Date: Mon Mar 11 16:34:19 2013 New Revision: 1455223 URL: http://svn.apache.org/r1455223 Log: Merge r1429559, r1451484 from trunk: According top my testing 'SSL_SESSION_id2sz' is 4x faster with the use 'ap_bin2hex' instead of apr_snprintf(..., "%02X" for each character. Output is the same. I have left the uppercase conversion, because I'm unsure if it is usefull or not. SSL_SESSION_id2sz is only used for logging, having it in lowercase shouldn't be an issue. Submitted by: jailletc36 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/modules/ssl/ssl_util_ssl.c Propchange: httpd/httpd/branches/2.4.x/ ------------------------------------------------------------------------------ Merged /httpd/httpd/trunk:r1429559,1451484 Modified: httpd/httpd/branches/2.4.x/STATUS URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1455223&r1=1455222&r2=1455223&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/STATUS (original) +++ httpd/httpd/branches/2.4.x/STATUS Mon Mar 11 16:34:19 2013 @@ -116,13 +116,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: 2.4.x patch: trunk patches apply (minus CHANGES for 1448171) 2.4.x cumulative patch: http://people.apache.org/~jailletc36/backport5.patch (minus CHANGES for 1448171) +1: jailletc36, igalic, jim - - * ssl_util_ssl: Speed up logging function by x4 using ap_bin2hex intoduced in 2.4.4 - It will be in lowercase instead of uppercase, but it is only for logging. I don't think this is a real issue. - trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1429559 - http://svn.apache.org/viewvc?view=revision&revision=1451484 - 2.4.x patch: trunk patch applies with offset. - +1: jailletc36, humbedooh, jim PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] Modified: httpd/httpd/branches/2.4.x/modules/ssl/ssl_util_ssl.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/ssl/ssl_util_ssl.c?rev=1455223&r1=1455222&r2=1455223&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/ssl/ssl_util_ssl.c (original) +++ httpd/httpd/branches/2.4.x/modules/ssl/ssl_util_ssl.c Mon Mar 11 16:34:19 2013 @@ -479,14 +479,15 @@ int SSL_CTX_use_certificate_chain( char *SSL_SESSION_id2sz(unsigned char *id, int idlen, char *str, int strsize) { - char *cp; - int n; + if (idlen > SSL_MAX_SSL_SESSION_ID_LENGTH) + idlen = SSL_MAX_SSL_SESSION_ID_LENGTH; + + /* We must ensure not to process more than what would fit in the + * destination buffer, including terminating NULL */ + if (idlen > (strsize-1) / 2) + idlen = (strsize-1) / 2; + + ap_bin2hex(id, idlen, str); - cp = str; - for (n = 0; n < idlen && n < SSL_MAX_SSL_SESSION_ID_LENGTH; n++) { - apr_snprintf(cp, strsize - (cp-str), "%02X", id[n]); - cp += 2; - } - *cp = NUL; return str; }