"name_cmp" caused a clash when linking with the static libcrypto.
The slight rename is better than nothing, as v3_ is an already existing
prefix.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/9979)
* https://www.openssl.org/source/license.html
*/
-int name_cmp(const char *name, const char *cmp);
+int v3_name_cmp(const char *name, const char *cmp);
extern const X509V3_EXT_METHOD v3_bcons, v3_nscert, v3_key_usage, v3_ext_ku;
extern const X509V3_EXT_METHOD v3_pkey_usage_period, v3_sxnet, v3_info, v3_sinfo;
const char *addr_chars = NULL;
int prefixlen, i1, i2, delim, length;
- if (!name_cmp(val->name, "IPv4")) {
+ if (!v3_name_cmp(val->name, "IPv4")) {
afi = IANA_AFI_IPV4;
- } else if (!name_cmp(val->name, "IPv6")) {
+ } else if (!v3_name_cmp(val->name, "IPv6")) {
afi = IANA_AFI_IPV6;
- } else if (!name_cmp(val->name, "IPv4-SAFI")) {
+ } else if (!v3_name_cmp(val->name, "IPv4-SAFI")) {
afi = IANA_AFI_IPV4;
safi = &safi_;
- } else if (!name_cmp(val->name, "IPv6-SAFI")) {
+ } else if (!v3_name_cmp(val->name, "IPv6-SAFI")) {
afi = IANA_AFI_IPV6;
safi = &safi_;
} else {
for (i = 0; i < num; i++) {
CONF_VALUE *cnf = sk_CONF_VALUE_value(nval, i);
- if (!name_cmp(cnf->name, "issuer")
+ if (!v3_name_cmp(cnf->name, "issuer")
&& cnf->value && strcmp(cnf->value, "copy") == 0) {
if (!copy_issuer(ctx, gens))
goto err;
for (i = 0; i < num; i++) {
cnf = sk_CONF_VALUE_value(nval, i);
- if (!name_cmp(cnf->name, "email")
+ if (!v3_name_cmp(cnf->name, "email")
&& cnf->value && strcmp(cnf->value, "copy") == 0) {
if (!copy_email(ctx, gens, 0))
goto err;
- } else if (!name_cmp(cnf->name, "email")
+ } else if (!v3_name_cmp(cnf->name, "email")
&& cnf->value && strcmp(cnf->value, "move") == 0) {
if (!copy_email(ctx, gens, 1))
goto err;
return NULL;
}
- if (!name_cmp(name, "email"))
+ if (!v3_name_cmp(name, "email"))
type = GEN_EMAIL;
- else if (!name_cmp(name, "URI"))
+ else if (!v3_name_cmp(name, "URI"))
type = GEN_URI;
- else if (!name_cmp(name, "DNS"))
+ else if (!v3_name_cmp(name, "DNS"))
type = GEN_DNS;
- else if (!name_cmp(name, "RID"))
+ else if (!v3_name_cmp(name, "RID"))
type = GEN_RID;
- else if (!name_cmp(name, "IP"))
+ else if (!v3_name_cmp(name, "IP"))
type = GEN_IPADD;
- else if (!name_cmp(name, "dirName"))
+ else if (!v3_name_cmp(name, "dirName"))
type = GEN_DIRNAME;
- else if (!name_cmp(name, "otherName"))
+ else if (!v3_name_cmp(name, "otherName"))
type = GEN_OTHERNAME;
else {
X509V3err(X509V3_F_V2I_GENERAL_NAME_EX, X509V3_R_UNSUPPORTED_OPTION);
/*
* Figure out whether this is an AS or an RDI.
*/
- if (!name_cmp(val->name, "AS")) {
+ if (!v3_name_cmp(val->name, "AS")) {
which = V3_ASID_ASNUM;
- } else if (!name_cmp(val->name, "RDI")) {
+ } else if (!v3_name_cmp(val->name, "RDI")) {
which = V3_ASID_RDI;
} else {
X509V3err(X509V3_F_V2I_ASIDENTIFIERS,
}
pol->policyid = pobj;
- } else if (!name_cmp(cnf->name, "CPS")) {
+ } else if (!v3_name_cmp(cnf->name, "CPS")) {
if (pol->qualifiers == NULL)
pol->qualifiers = sk_POLICYQUALINFO_new_null();
if ((qual = POLICYQUALINFO_new()) == NULL)
if (!ASN1_STRING_set(qual->d.cpsuri, cnf->value,
strlen(cnf->value)))
goto merr;
- } else if (!name_cmp(cnf->name, "userNotice")) {
+ } else if (!v3_name_cmp(cnf->name, "userNotice")) {
STACK_OF(CONF_VALUE) *unot;
if (*cnf->value != '@') {
X509V3err(X509V3_F_POLICY_SECTION,
* V2I name comparison function: returns zero if 'name' matches cmp or cmp.*
*/
-int name_cmp(const char *name, const char *cmp)
+int v3_name_cmp(const char *name, const char *cmp)
{
int len, ret;
char c;