From: Richard Levitte Date: Fri, 27 May 2016 08:12:58 +0000 (+0200) Subject: Remove internal functions OPENSSL_strcasecmp and OPENSSL_strncasecmp X-Git-Tag: OpenSSL_1_1_0-pre6~667 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7233bea26350d0541909a2fe30e87a95327fb065;p=oweals%2Fopenssl.git Remove internal functions OPENSSL_strcasecmp and OPENSSL_strncasecmp Their only reason to exist was that they didn't exist in VMS before version 7.0. We do not support such old versions any more. However, for the benefit of systems that don't get strings.h included by string.h, we include the former in e_os.h. RT#4458 Reviewed-by: Viktor Dukhovni --- diff --git a/crypto/o_str.c b/crypto/o_str.c index b0e7524820..29c324f474 100644 --- a/crypto/o_str.c +++ b/crypto/o_str.c @@ -14,49 +14,6 @@ #include "internal/cryptlib.h" #include "internal/o_str.h" -#if !defined(OPENSSL_IMPLEMENTS_strncasecmp) && \ - !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_WINCE) && \ - !defined(NETWARE_CLIB) -# include -#endif - -int OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n) -{ -#if defined(OPENSSL_IMPLEMENTS_strncasecmp) - while (*str1 && *str2 && n) { - int res = toupper(*str1) - toupper(*str2); - if (res) - return res < 0 ? -1 : 1; - str1++; - str2++; - n--; - } - if (n == 0) - return 0; - if (*str1) - return 1; - if (*str2) - return -1; - return 0; -#else - /* - * Recursion hazard warning! Whenever strncasecmp is #defined as - * OPENSSL_strncasecmp, OPENSSL_IMPLEMENTS_strncasecmp must be defined as - * well. - */ - return strncasecmp(str1, str2, n); -#endif -} - -int OPENSSL_strcasecmp(const char *str1, const char *str2) -{ -#if defined(OPENSSL_IMPLEMENTS_strncasecmp) - return OPENSSL_strncasecmp(str1, str2, (size_t)-1); -#else - return strcasecmp(str1, str2); -#endif -} - int OPENSSL_memcmp(const void *v1, const void *v2, size_t n) { const unsigned char *c1 = v1, *c2 = v2; diff --git a/e_os.h b/e_os.h index 53e0ecf800..700d7d05ce 100644 --- a/e_os.h +++ b/e_os.h @@ -476,12 +476,8 @@ struct servent *PASCAL getservbyname(const char *, const char *); # define strdup _strdup # define unlink _unlink # endif -# elif defined(OPENSSL_SYS_VMS) -/* VMS below version 7.0 doesn't have strcasecmp() */ -# include "internal/o_str.h" -# define strcasecmp OPENSSL_strcasecmp -# define strncasecmp OPENSSL_strncasecmp -# define OPENSSL_IMPLEMENTS_strncasecmp +# else +# include # endif /* vxworks */ diff --git a/include/internal/o_str.h b/include/internal/o_str.h index c1bf7ef039..86403c9ee2 100644 --- a/include/internal/o_str.h +++ b/include/internal/o_str.h @@ -12,8 +12,6 @@ # include /* to get size_t */ -int OPENSSL_strcasecmp(const char *str1, const char *str2); -int OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n); int OPENSSL_memcmp(const void *p1, const void *p2, size_t n); #endif