From efaa569c3b0e131cc760138f3c4bc27972a21dc1 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 17 Jun 2009 11:55:51 +0000 Subject: [PATCH] PR: 1943 Submitted by: Guenter Approved by: steve@openssl.org Rename uni2asc and asc2uni on Netware to avoid a name clash. --- CHANGES | 5 +++++ apps/pkcs12.c | 6 ++++++ crypto/pkcs12/p12_attr.c | 6 ++++++ crypto/pkcs12/p12_key.c | 6 ++++++ crypto/pkcs12/p12_utl.c | 6 ++++++ crypto/pkcs12/pkcs12.h | 7 ++++++- 6 files changed, 35 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 6be0a73f7e..cf448874ca 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,11 @@ Changes between 0.9.8k and 0.9.8l [xx XXX xxxx] + *) Rename uni2asc and asc2uni functions to OPENSSL_uni2asc and + OPENSSL_asc2uni conditionally on Netware platforms to avoid a name + clash. + [Steve Henson] + *) Don't check self signed certificate signatures in X509_verify_cert(): it just wastes time without adding any security. As a useful side effect self signed root CAs with non-FIPS digests are now usable in FIPS mode. diff --git a/apps/pkcs12.c b/apps/pkcs12.c index 248bc1154d..0db0b79765 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -68,6 +68,12 @@ #include #include +#ifdef OPENSSL_SYS_NETWARE +/* Rename these functions to avoid name clashes on NetWare OS */ +#define uni2asc OPENSSL_uni2asc +#define asc2uni OPENSSL_asc2uni +#endif + #define PROG pkcs12_main const EVP_CIPHER *enc; diff --git a/crypto/pkcs12/p12_attr.c b/crypto/pkcs12/p12_attr.c index 68d6c5ad15..856933d978 100644 --- a/crypto/pkcs12/p12_attr.c +++ b/crypto/pkcs12/p12_attr.c @@ -60,6 +60,12 @@ #include "cryptlib.h" #include +#ifdef OPENSSL_SYS_NETWARE +/* Rename these functions to avoid name clashes on NetWare OS */ +#define uni2asc OPENSSL_uni2asc +#define asc2uni OPENSSL_asc2uni +#endif + /* Add a local keyid to a safebag */ int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, diff --git a/crypto/pkcs12/p12_key.c b/crypto/pkcs12/p12_key.c index 9e57eee4a4..5cfe7278df 100644 --- a/crypto/pkcs12/p12_key.c +++ b/crypto/pkcs12/p12_key.c @@ -69,6 +69,12 @@ extern BIO *bio_err; void h__dump (unsigned char *p, int len); #endif +#ifdef OPENSSL_SYS_NETWARE +/* Rename these functions to avoid name clashes on NetWare OS */ +#define uni2asc OPENSSL_uni2asc +#define asc2uni OPENSSL_asc2uni +#endif + /* PKCS12 compatible key/IV generation */ #ifndef min #define min(a,b) ((a) < (b) ? (a) : (b)) diff --git a/crypto/pkcs12/p12_utl.c b/crypto/pkcs12/p12_utl.c index ca30ac4f6d..2edbf905c5 100644 --- a/crypto/pkcs12/p12_utl.c +++ b/crypto/pkcs12/p12_utl.c @@ -60,6 +60,12 @@ #include "cryptlib.h" #include +#ifdef OPENSSL_SYS_NETWARE +/* Rename these functions to avoid name clashes on NetWare OS */ +#define uni2asc OPENSSL_uni2asc +#define asc2uni OPENSSL_asc2uni +#endif + /* Cheap and nasty Unicode stuff */ unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen) diff --git a/crypto/pkcs12/pkcs12.h b/crypto/pkcs12/pkcs12.h index 4bee605dc0..78317fb1fa 100644 --- a/crypto/pkcs12/pkcs12.h +++ b/crypto/pkcs12/pkcs12.h @@ -232,9 +232,14 @@ int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, const EVP_MD *md_type); int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, const EVP_MD *md_type); +#if defined(NETWARE) || defined(OPENSSL_SYS_NETWARE) +/* Rename these functions to avoid name clashes on NetWare OS */ +unsigned char *OPENSSL_asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen); +char *OPENSSL_uni2asc(unsigned char *uni, int unilen); +#else unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen); char *uni2asc(unsigned char *uni, int unilen); - +#endif DECLARE_ASN1_FUNCTIONS(PKCS12) DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA) DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG) -- 2.25.1