summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2004-02-29 00:03:15 +0100
committerJoe Orton <jorton@apache.org>2004-02-29 00:03:15 +0100
commitdd2b6c2bf838a148251f8638103dbcdcdd85cae1 (patch)
tree71583a2039313df08c32a605b63e354804e7acbf
parentsync (diff)
downloadapache2-dd2b6c2bf838a148251f8638103dbcdcdd85cae1.tar.xz
apache2-dd2b6c2bf838a148251f8638103dbcdcdd85cae1.zip
* modules/ssl/ssl_engine_vars.c (ssl_var_lookup_ssl_cert_dn): Simplify
to use apr_pstrmemdup. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102815 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/ssl/ssl_engine_vars.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/modules/ssl/ssl_engine_vars.c b/modules/ssl/ssl_engine_vars.c
index 666de3f014..4d3ba48072 100644
--- a/modules/ssl/ssl_engine_vars.c
+++ b/modules/ssl/ssl_engine_vars.c
@@ -376,8 +376,6 @@ static char *ssl_var_lookup_ssl_cert_dn(apr_pool_t *p, X509_NAME *xsname, char *
char *result, *ptr;
X509_NAME_ENTRY *xsne;
int i, j, n, idx = 0;
- unsigned char *data_ptr;
- int data_len;
apr_size_t varlen;
/* if an _N suffix is used, find the Nth attribute of given name */
@@ -401,16 +399,15 @@ static char *ssl_var_lookup_ssl_cert_dn(apr_pool_t *p, X509_NAME *xsname, char *
X509_NAME_get_entries(xsname), j);
n =OBJ_obj2nid((ASN1_OBJECT *)X509_NAME_ENTRY_get_object(xsne));
- data_ptr = X509_NAME_ENTRY_get_data_ptr(xsne);
- data_len = X509_NAME_ENTRY_get_data_len(xsne);
if (n == ssl_var_lookup_ssl_cert_dn_rec[i].nid && idx-- == 0) {
- result = apr_palloc(p, data_len+1);
- apr_cpystrn(result, (char *)data_ptr, data_len+1);
+ result = apr_pstrmemdup(p,
+ X509_NAME_ENTRY_get_data_ptr(xsne),
+ X509_NAME_ENTRY_get_data_len(xsne));
#ifdef CHARSET_EBCDIC
- ascii2ebcdic(result, result, xsne->value->length);
+ ascii2ebcdic(result, result,
+ X509_NAME_ENTRY_get_data_len(xsne));
#endif /* CHARSET_EBCDIC */
- result[data_len] = NUL;
break;
}
}