diff options
author | Andy Polyakov <appro@openssl.org> | 2005-09-20 20:19:07 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2005-09-20 20:19:07 +0000 |
commit | 7a06050cd356001ec80a9202f50de6eb4e09f6e7 (patch) | |
tree | f58dc4c4533fb0ce0d689b52bb6bbdf4d07ec59d | |
parent | 6f9afa68cdd33acb24ac3c8bb43eff179108a73e (diff) |
"Overload" SunOS 4.x memcmp, which ruins ASN1_OBJECT table lookups.
PR: 1196
Submitted by: Russel Ruby
-rw-r--r-- | crypto/asn1/tasn_enc.c | 1 | ||||
-rw-r--r-- | crypto/o_str.c | 9 | ||||
-rw-r--r-- | crypto/o_str.h | 1 | ||||
-rw-r--r-- | e_os.h | 3 |
4 files changed, 14 insertions, 0 deletions
diff --git a/crypto/asn1/tasn_enc.c b/crypto/asn1/tasn_enc.c index 4ab1ea10f5..60b29ce822 100644 --- a/crypto/asn1/tasn_enc.c +++ b/crypto/asn1/tasn_enc.c @@ -59,6 +59,7 @@ #include <stddef.h> #include <string.h> +#include "cryptlib.h" #include <openssl/asn1.h> #include <openssl/asn1t.h> #include <openssl/objects.h> diff --git a/crypto/o_str.c b/crypto/o_str.c index da8860491d..2db099333a 100644 --- a/crypto/o_str.c +++ b/crypto/o_str.c @@ -94,3 +94,12 @@ int OPENSSL_strcasecmp(const char *str1, const char *str2) #endif } +int OPENSSL_memcmp(const void *v1,const void *v2,size_t n) + { + const unsigned char *c1=v1,*c2=v2; + int ret=0; + + while(n && (ret=*c1-*c2)==0) n--,c1++,c2++; + + return ret; + } diff --git a/crypto/o_str.h b/crypto/o_str.h index 4a70a9e00b..dfc98494c6 100644 --- a/crypto/o_str.h +++ b/crypto/o_str.h @@ -63,5 +63,6 @@ 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 @@ -565,6 +565,9 @@ extern HINSTANCE _hInstance; extern char *sys_errlist[]; extern int sys_nerr; # define strerror(errnum) \ (((errnum)<0 || (errnum)>=sys_nerr) ? NULL : sys_errlist[errnum]) + /* Being signed SunOS 4.x memcpy breaks ASN1_OBJECT table lookup */ +#include "o_str.h" +# define memcmp OPENSSL_memcmp #endif #ifndef OPENSSL_EXIT |