From f10b0ad3dcff540a384566ab55522f15440da448 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 25 May 2004 12:16:53 +0000 Subject: [PATCH] * modules/ssl/ssl_util.c, modules/ssl/ssl_private.h: Remove unused functions ssl_util_strupper, ssl_util_ptxtstub, and ssl_util_uuencode*. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103755 13f79535-47bb-0310-9956-ffa450edef68 --- modules/ssl/ssl_private.h | 4 -- modules/ssl/ssl_util.c | 101 -------------------------------------- 2 files changed, 105 deletions(-) diff --git a/modules/ssl/ssl_private.h b/modules/ssl/ssl_private.h index d756ee3495..80a4c7efa0 100644 --- a/modules/ssl/ssl_private.h +++ b/modules/ssl/ssl_private.h @@ -587,9 +587,6 @@ int ssl_rand_seed(server_rec *, apr_pool_t *, ssl_rsctx_t, char *); /* Utility Functions */ char *ssl_util_vhostid(apr_pool_t *, server_rec *); -void ssl_util_strupper(char *); -void ssl_util_uuencode(char *, const char *, BOOL); -void ssl_util_uuencode_binary(unsigned char *, const unsigned char *, int, BOOL); apr_file_t *ssl_util_ppopen(server_rec *, apr_pool_t *, const char *, const char * const *); void ssl_util_ppclose(server_rec *, apr_pool_t *, apr_file_t *); @@ -598,7 +595,6 @@ char *ssl_util_readfilter(server_rec *, apr_pool_t *, const char *, BOOL ssl_util_path_check(ssl_pathcheck_t, const char *, apr_pool_t *); ssl_algo_t ssl_util_algotypeof(X509 *, EVP_PKEY *); char *ssl_util_algotypestr(ssl_algo_t); -char *ssl_util_ptxtsub(apr_pool_t *, const char *, const char *, char *); void ssl_util_thread_setup(apr_pool_t *); int ssl_init_ssl_connection(conn_rec *c); diff --git a/modules/ssl/ssl_util.c b/modules/ssl/ssl_util.c index 585360adea..e675d3929c 100644 --- a/modules/ssl/ssl_util.c +++ b/modules/ssl/ssl_util.c @@ -59,52 +59,6 @@ char *ssl_util_vhostid(apr_pool_t *p, server_rec *s) return id; } -void ssl_util_strupper(char *s) -{ - for (; *s; ++s) - *s = apr_toupper(*s); - return; -} - -static const char ssl_util_uuencode_six2pr[64+1] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -void ssl_util_uuencode(char *szTo, const char *szFrom, BOOL bPad) -{ - ssl_util_uuencode_binary((unsigned char *)szTo, - (const unsigned char *)szFrom, - strlen(szFrom), bPad); -} - -void ssl_util_uuencode_binary(unsigned char *szTo, - const unsigned char *szFrom, - int nLength, BOOL bPad) -{ - const unsigned char *s; - int nPad = 0; - - for (s = szFrom; nLength > 0; s += 3) { - *szTo++ = ssl_util_uuencode_six2pr[s[0] >> 2]; - *szTo++ = ssl_util_uuencode_six2pr[(s[0] << 4 | s[1] >> 4) & 0x3f]; - if (--nLength == 0) { - nPad = 2; - break; - } - *szTo++ = ssl_util_uuencode_six2pr[(s[1] << 2 | s[2] >> 6) & 0x3f]; - if (--nLength == 0) { - nPad = 1; - break; - } - *szTo++ = ssl_util_uuencode_six2pr[s[2] & 0x3f]; - --nLength; - } - while(bPad && nPad--) { - *szTo++ = NUL; - } - *szTo = NUL; - return; -} - apr_file_t *ssl_util_ppopen(server_rec *s, apr_pool_t *p, const char *cmd, const char * const *argv) { @@ -219,61 +173,6 @@ char *ssl_util_algotypestr(ssl_algo_t t) return cp; } -char *ssl_util_ptxtsub(apr_pool_t *p, const char *cpLine, - const char *cpMatch, char *cpSubst) -{ -#define MAX_PTXTSUB 100 - char *cppMatch[MAX_PTXTSUB]; - char *cpResult; - int nResult; - int nLine; - int nSubst; - int nMatch; - char *cpI; - char *cpO; - char *cp; - int i; - - /* - * Pass 1: find substitution locations and calculate sizes - */ - nLine = strlen(cpLine); - nMatch = strlen(cpMatch); - nSubst = strlen(cpSubst); - for (cpI = (char *)cpLine, i = 0, nResult = 0; - cpI < cpLine+nLine && i < MAX_PTXTSUB; ) { - if ((cp = strstr(cpI, cpMatch)) != NULL) { - cppMatch[i++] = cp; - nResult += ((cp-cpI)+nSubst); - cpI = (cp+nMatch); - } - else { - nResult += strlen(cpI); - break; - } - } - cppMatch[i] = NULL; - if (i == 0) - return NULL; - - /* - * Pass 2: allocate memory and assemble result - */ - cpResult = apr_pcalloc(p, nResult+1); - for (cpI = (char *)cpLine, cpO = cpResult, i = 0; - cppMatch[i] != NULL; - i++) { - apr_cpystrn(cpO, cpI, cppMatch[i]-cpI+1); - cpO += (cppMatch[i]-cpI); - apr_cpystrn(cpO, cpSubst, nSubst+1); - cpO += nSubst; - cpI = (cppMatch[i]+nMatch); - } - apr_cpystrn(cpO, cpI, cpResult+nResult-cpO+1); - - return cpResult; -} - /* * certain key and cert data needs to survive restarts, * which are stored in the user data table of s->process->pool. -- 2.40.0