From: Shane Lontis Date: Tue, 9 Mar 2021 04:43:28 +0000 (+1000) Subject: Add ossl_pem_check_suffix symbol X-Git-Tag: openssl-3.0.0-alpha14~227 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b78c016649d13c48429c132e56314117f8f3d9d7;p=thirdparty%2Fopenssl.git Add ossl_pem_check_suffix symbol Partial fix for #12964 Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/14473) --- diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 7695699c739..c8e0b264dac 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -29,7 +29,7 @@ static int load_iv(char **fromp, unsigned char *to, int num); static int check_pem(const char *nm, const char *name); -int pem_check_suffix(const char *pem_str, const char *suffix); +int ossl_pem_check_suffix(const char *pem_str, const char *suffix); int PEM_def_callback(char *buf, int num, int rwflag, void *userdata) { @@ -138,7 +138,7 @@ static int check_pem(const char *nm, const char *name) return 1; if (strcmp(nm, PEM_STRING_PKCS8INF) == 0) return 1; - slen = pem_check_suffix(nm, "PRIVATE KEY"); + slen = ossl_pem_check_suffix(nm, "PRIVATE KEY"); if (slen > 0) { /* * NB: ENGINE implementations won't contain a deprecated old @@ -154,7 +154,7 @@ static int check_pem(const char *nm, const char *name) if (strcmp(name, PEM_STRING_PARAMETERS) == 0) { int slen; const EVP_PKEY_ASN1_METHOD *ameth; - slen = pem_check_suffix(nm, "PARAMETERS"); + slen = ossl_pem_check_suffix(nm, "PARAMETERS"); if (slen > 0) { ENGINE *e; ameth = EVP_PKEY_asn1_find_str(&e, nm, slen); @@ -1006,7 +1006,7 @@ int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data, * string "RSA". */ -int pem_check_suffix(const char *pem_str, const char *suffix) +int ossl_pem_check_suffix(const char *pem_str, const char *suffix) { int pem_len = strlen(pem_str); int suffix_len = strlen(suffix); diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c index 26c6bbbaf63..e5b740f214f 100644 --- a/crypto/pem/pem_pkey.c +++ b/crypto/pem/pem_pkey.c @@ -27,7 +27,7 @@ #include "crypto/evp.h" #include "pem_local.h" -int pem_check_suffix(const char *pem_str, const char *suffix); +int ossl_pem_check_suffix(const char *pem_str, const char *suffix); static EVP_PKEY *pem_read_bio_key(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u,