summaryrefslogtreecommitdiffstats
path: root/crypto/x509v3
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-06-01 22:19:21 +0000
committerRichard Levitte <levitte@openssl.org>2000-06-01 22:19:21 +0000
commit26a3a48d65c7464b400ec1de439994d7f0d25fed (patch)
tree91abb7d351b174e58f60e5353b731b916eaf0c5c /crypto/x509v3
parentde42b6a7a82be33d2976ab605e74d7bc95b71447 (diff)
There have been a number of complaints from a number of sources that names
like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
Diffstat (limited to 'crypto/x509v3')
-rw-r--r--crypto/x509v3/v3_akey.c6
-rw-r--r--crypto/x509v3/v3_bcons.c2
-rw-r--r--crypto/x509v3/v3_conf.c4
-rw-r--r--crypto/x509v3/v3_cpols.c10
-rw-r--r--crypto/x509v3/v3_crld.c4
-rw-r--r--crypto/x509v3/v3_genn.c4
-rw-r--r--crypto/x509v3/v3_ia5.c2
-rw-r--r--crypto/x509v3/v3_info.c12
-rw-r--r--crypto/x509v3/v3_lib.c4
-rw-r--r--crypto/x509v3/v3_pku.c2
-rw-r--r--crypto/x509v3/v3_prn.c2
-rw-r--r--crypto/x509v3/v3_purp.c14
-rw-r--r--crypto/x509v3/v3_sxnet.c6
-rw-r--r--crypto/x509v3/v3_utl.c34
14 files changed, 53 insertions, 53 deletions
diff --git a/crypto/x509v3/v3_akey.c b/crypto/x509v3/v3_akey.c
index 96c04fe4f5..877ae7da7b 100644
--- a/crypto/x509v3/v3_akey.c
+++ b/crypto/x509v3/v3_akey.c
@@ -132,7 +132,7 @@ void AUTHORITY_KEYID_free(AUTHORITY_KEYID *a)
M_ASN1_OCTET_STRING_free(a->keyid);
sk_GENERAL_NAME_pop_free(a->issuer, GENERAL_NAME_free);
M_ASN1_INTEGER_free (a->serial);
- Free (a);
+ OPENSSL_free (a);
}
static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
@@ -142,7 +142,7 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
if(akeyid->keyid) {
tmp = hex_to_string(akeyid->keyid->data, akeyid->keyid->length);
X509V3_add_value("keyid", tmp, &extlist);
- Free(tmp);
+ OPENSSL_free(tmp);
}
if(akeyid->issuer)
extlist = i2v_GENERAL_NAMES(NULL, akeyid->issuer, extlist);
@@ -150,7 +150,7 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
tmp = hex_to_string(akeyid->serial->data,
akeyid->serial->length);
X509V3_add_value("serial", tmp, &extlist);
- Free(tmp);
+ OPENSSL_free(tmp);
}
return extlist;
}
diff --git a/crypto/x509v3/v3_bcons.c b/crypto/x509v3/v3_bcons.c
index 1e3edc205f..c576b8e955 100644
--- a/crypto/x509v3/v3_bcons.c
+++ b/crypto/x509v3/v3_bcons.c
@@ -123,7 +123,7 @@ void BASIC_CONSTRAINTS_free(BASIC_CONSTRAINTS *a)
{
if (a == NULL) return;
M_ASN1_INTEGER_free (a->pathlen);
- Free (a);
+ OPENSSL_free (a);
}
static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
diff --git a/crypto/x509v3/v3_conf.c b/crypto/x509v3/v3_conf.c
index b2f03010cc..bdc9c1cbc1 100644
--- a/crypto/x509v3/v3_conf.c
+++ b/crypto/x509v3/v3_conf.c
@@ -167,7 +167,7 @@ static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid,
X509_EXTENSION *ext;
/* Convert internal representation to DER */
ext_len = method->i2d(ext_struc, NULL);
- if(!(ext_der = Malloc(ext_len))) goto merr;
+ if(!(ext_der = OPENSSL_malloc(ext_len))) goto merr;
p = ext_der;
method->i2d(ext_struc, &p);
if(!(ext_oct = M_ASN1_OCTET_STRING_new())) goto merr;
@@ -255,7 +255,7 @@ extension = X509_EXTENSION_create_by_OBJ(NULL, obj, crit, oct);
err:
ASN1_OBJECT_free(obj);
M_ASN1_OCTET_STRING_free(oct);
-if(ext_der) Free(ext_der);
+if(ext_der) OPENSSL_free(ext_der);
return extension;
}
diff --git a/crypto/x509v3/v3_cpols.c b/crypto/x509v3/v3_cpols.c
index da9dbe1c10..8203ed7571 100644
--- a/crypto/x509v3/v3_cpols.c
+++ b/crypto/x509v3/v3_cpols.c
@@ -401,7 +401,7 @@ void POLICYINFO_free(POLICYINFO *a)
if (a == NULL) return;
ASN1_OBJECT_free(a->policyid);
sk_POLICYQUALINFO_pop_free(a->qualifiers, POLICYQUALINFO_free);
- Free (a);
+ OPENSSL_free (a);
}
static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals,
@@ -451,7 +451,7 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent)
if(i) BIO_puts(out, ", ");
tmp = i2s_ASN1_INTEGER(NULL, num);
BIO_puts(out, tmp);
- Free(tmp);
+ OPENSSL_free(tmp);
}
BIO_puts(out, "\n");
}
@@ -553,7 +553,7 @@ void POLICYQUALINFO_free(POLICYQUALINFO *a)
}
ASN1_OBJECT_free(a->pqualid);
- Free (a);
+ OPENSSL_free (a);
}
int i2d_USERNOTICE(USERNOTICE *a, unsigned char **pp)
@@ -599,7 +599,7 @@ void USERNOTICE_free(USERNOTICE *a)
if (a == NULL) return;
NOTICEREF_free(a->noticeref);
M_DISPLAYTEXT_free(a->exptext);
- Free (a);
+ OPENSSL_free (a);
}
int i2d_NOTICEREF(NOTICEREF *a, unsigned char **pp)
@@ -653,7 +653,7 @@ void NOTICEREF_free(NOTICEREF *a)
if (a == NULL) return;
M_DISPLAYTEXT_free(a->organization);
sk_ASN1_INTEGER_pop_free(a->noticenos, ASN1_STRING_free);
- Free (a);
+ OPENSSL_free (a);
}
IMPLEMENT_STACK_OF(POLICYQUALINFO)
diff --git a/crypto/x509v3/v3_crld.c b/crypto/x509v3/v3_crld.c
index e459d2595a..4fd61f2cf3 100644
--- a/crypto/x509v3/v3_crld.c
+++ b/crypto/x509v3/v3_crld.c
@@ -213,7 +213,7 @@ void DIST_POINT_free(DIST_POINT *a)
DIST_POINT_NAME_free(a->distpoint);
M_ASN1_BIT_STRING_free(a->reasons);
sk_GENERAL_NAME_pop_free(a->CRLissuer, GENERAL_NAME_free);
- Free (a);
+ OPENSSL_free (a);
}
int i2d_DIST_POINT_NAME(DIST_POINT_NAME *a, unsigned char **pp)
@@ -256,7 +256,7 @@ void DIST_POINT_NAME_free(DIST_POINT_NAME *a)
if (a == NULL) return;
sk_X509_NAME_ENTRY_pop_free(a->relativename, X509_NAME_ENTRY_free);
sk_GENERAL_NAME_pop_free(a->fullname, GENERAL_NAME_free);
- Free (a);
+ OPENSSL_free (a);
}
DIST_POINT_NAME *d2i_DIST_POINT_NAME(DIST_POINT_NAME **a, unsigned char **pp,
diff --git a/crypto/x509v3/v3_genn.c b/crypto/x509v3/v3_genn.c
index 894afa7e03..2de1c4b428 100644
--- a/crypto/x509v3/v3_genn.c
+++ b/crypto/x509v3/v3_genn.c
@@ -211,7 +211,7 @@ void GENERAL_NAME_free(GENERAL_NAME *a)
break;
}
- Free (a);
+ OPENSSL_free (a);
}
/* Now the GeneralNames versions: a SEQUENCE OF GeneralName. These are needed as
@@ -286,6 +286,6 @@ void OTHERNAME_free(OTHERNAME *a)
if (a == NULL) return;
ASN1_OBJECT_free(a->type_id);
ASN1_TYPE_free(a->value);
- Free (a);
+ OPENSSL_free (a);
}
diff --git a/crypto/x509v3/v3_ia5.c b/crypto/x509v3/v3_ia5.c
index af3525f33e..f3bba38269 100644
--- a/crypto/x509v3/v3_ia5.c
+++ b/crypto/x509v3/v3_ia5.c
@@ -82,7 +82,7 @@ static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
{
char *tmp;
if(!ia5 || !ia5->length) return NULL;
- tmp = Malloc(ia5->length + 1);
+ tmp = OPENSSL_malloc(ia5->length + 1);
memcpy(tmp, ia5->data, ia5->length);
tmp[ia5->length] = 0;
return tmp;
diff --git a/crypto/x509v3/v3_info.c b/crypto/x509v3/v3_info.c
index 78d2135046..9ada0b310b 100644
--- a/crypto/x509v3/v3_info.c
+++ b/crypto/x509v3/v3_info.c
@@ -94,7 +94,7 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method
if(!ret) break;
vtmp = sk_CONF_VALUE_value(ret, i);
i2t_ASN1_OBJECT(objtmp, 80, desc->method);
- ntmp = Malloc(strlen(objtmp) + strlen(vtmp->name) + 5);
+ ntmp = OPENSSL_malloc(strlen(objtmp) + strlen(vtmp->name) + 5);
if(!ntmp) {
X509V3err(X509V3_F_I2V_AUTHORITY_INFO_ACCESS,
ERR_R_MALLOC_FAILURE);
@@ -103,7 +103,7 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method
strcpy(ntmp, objtmp);
strcat(ntmp, " - ");
strcat(ntmp, vtmp->name);
- Free(vtmp->name);
+ OPENSSL_free(vtmp->name);
vtmp->name = ntmp;
}
@@ -140,7 +140,7 @@ static STACK_OF(ACCESS_DESCRIPTION) *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
ctmp.value = cnf->value;
if(!(acc->location = v2i_GENERAL_NAME(method, ctx, &ctmp)))
goto err;
- if(!(objtmp = Malloc(objlen + 1))) {
+ if(!(objtmp = OPENSSL_malloc(objlen + 1))) {
X509V3err(X509V3_F_V2I_ACCESS_DESCRIPTION,ERR_R_MALLOC_FAILURE);
goto err;
}
@@ -150,10 +150,10 @@ static STACK_OF(ACCESS_DESCRIPTION) *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
if(!acc->method) {
X509V3err(X509V3_F_V2I_ACCESS_DESCRIPTION,X509V3_R_BAD_OBJECT);
ERR_add_error_data(2, "value=", objtmp);
- Free(objtmp);
+ OPENSSL_free(objtmp);
goto err;
}
- Free(objtmp);
+ OPENSSL_free(objtmp);
}
return ainfo;
@@ -204,7 +204,7 @@ void ACCESS_DESCRIPTION_free(ACCESS_DESCRIPTION *a)
if (a == NULL) return;
ASN1_OBJECT_free(a->method);
GENERAL_NAME_free(a->location);
- Free (a);
+ OPENSSL_free (a);
}
STACK_OF(ACCESS_DESCRIPTION) *AUTHORITY_INFO_ACCESS_new(void)
diff --git a/crypto/x509v3/v3_lib.c b/crypto/x509v3/v3_lib.c
index aa04fb24aa..8f90970297 100644
--- a/crypto/x509v3/v3_lib.c
+++ b/crypto/x509v3/v3_lib.c
@@ -127,7 +127,7 @@ int X509V3_EXT_add_alias(int nid_to, int nid_from)
X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS,X509V3_R_EXTENSION_NOT_FOUND);
return 0;
}
- if(!(tmpext = (X509V3_EXT_METHOD *)Malloc(sizeof(X509V3_EXT_METHOD)))) {
+ if(!(tmpext = (X509V3_EXT_METHOD *)OPENSSL_malloc(sizeof(X509V3_EXT_METHOD)))) {
X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS,ERR_R_MALLOC_FAILURE);
return 0;
}
@@ -145,7 +145,7 @@ void X509V3_EXT_cleanup(void)
static void ext_list_free(X509V3_EXT_METHOD *ext)
{
- if(ext->ext_flags & X509V3_EXT_DYNAMIC) Free(ext);
+ if(ext->ext_flags & X509V3_EXT_DYNAMIC) OPENSSL_free(ext);
}
/* Legacy function: we don't need to add standard extensions
diff --git a/crypto/x509v3/v3_pku.c b/crypto/x509v3/v3_pku.c
index 30a62c6090..47f9e8f123 100644
--- a/crypto/x509v3/v3_pku.c
+++ b/crypto/x509v3/v3_pku.c
@@ -121,7 +121,7 @@ void PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *a)
if (a == NULL) return;
M_ASN1_GENERALIZEDTIME_free(a->notBefore);
M_ASN1_GENERALIZEDTIME_free(a->notAfter);
- Free (a);
+ OPENSSL_free (a);
}
static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method,
diff --git a/crypto/x509v3/v3_prn.c b/crypto/x509v3/v3_prn.c
index bee624c6be..dbc4fb1f16 100644
--- a/crypto/x509v3/v3_prn.c
+++ b/crypto/x509v3/v3_prn.c
@@ -133,7 +133,7 @@ int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, int flag, int indent)
err:
sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
- if(value) Free(value);
+ if(value) OPENSSL_free(value);
method->ext_free(ext_str);
return ok;
}
diff --git a/crypto/x509v3/v3_purp.c b/crypto/x509v3/v3_purp.c
index 488b97f025..d84d0130ae 100644
--- a/crypto/x509v3/v3_purp.c
+++ b/crypto/x509v3/v3_purp.c
@@ -171,17 +171,17 @@ int X509_PURPOSE_add(int id, int trust, int flags,
idx = X509_PURPOSE_get_by_id(id);
/* Need a new entry */
if(idx == -1) {
- if(!(ptmp = Malloc(sizeof(X509_PURPOSE)))) {
+ if(!(ptmp = OPENSSL_malloc(sizeof(X509_PURPOSE)))) {
X509V3err(X509V3_F_X509_PURPOSE_ADD,ERR_R_MALLOC_FAILURE);
return 0;
}
ptmp->flags = X509_PURPOSE_DYNAMIC;
} else ptmp = X509_PURPOSE_get0(idx);
- /* Free existing name if dynamic */
+ /* OPENSSL_free existing name if dynamic */
if(ptmp->flags & X509_PURPOSE_DYNAMIC_NAME) {
- Free(ptmp->name);
- Free(ptmp->sname);
+ OPENSSL_free(ptmp->name);
+ OPENSSL_free(ptmp->sname);
}
/* dup supplied name */
ptmp->name = BUF_strdup(name);
@@ -220,10 +220,10 @@ static void xptable_free(X509_PURPOSE *p)
if (p->flags & X509_PURPOSE_DYNAMIC)
{
if (p->flags & X509_PURPOSE_DYNAMIC_NAME) {
- Free(p->name);
- Free(p->sname);
+ OPENSSL_free(p->name);
+ OPENSSL_free(p->sname);
}
- Free(p);
+ OPENSSL_free(p);
}
}
diff --git a/crypto/x509v3/v3_sxnet.c b/crypto/x509v3/v3_sxnet.c
index 20ba8ac8d6..bfecacd336 100644
--- a/crypto/x509v3/v3_sxnet.c
+++ b/crypto/x509v3/v3_sxnet.c
@@ -132,7 +132,7 @@ void SXNET_free(SXNET *a)
if (a == NULL) return;
M_ASN1_INTEGER_free(a->version);
sk_SXNETID_pop_free(a->ids, SXNETID_free);
- Free (a);
+ OPENSSL_free (a);
}
int i2d_SXNETID(SXNETID *a, unsigned char **pp)
@@ -176,7 +176,7 @@ void SXNETID_free(SXNETID *a)
if (a == NULL) return;
M_ASN1_INTEGER_free(a->zone);
M_ASN1_OCTET_STRING_free(a->user);
- Free (a);
+ OPENSSL_free (a);
}
static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out,
@@ -192,7 +192,7 @@ static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out,
id = sk_SXNETID_value(sx->ids, i);
tmp = i2s_ASN1_INTEGER(NULL, id->zone);
BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp);
- Free(tmp);
+ OPENSSL_free(tmp);
M_ASN1_OCTET_STRING_print(out, id->user);
}
return 1;
diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c
index 4c2c4a9483..3f567180c5 100644
--- a/crypto/x509v3/v3_utl.c
+++ b/crypto/x509v3/v3_utl.c
@@ -75,7 +75,7 @@ int X509V3_add_value(const char *name, const char *value,
char *tname = NULL, *tvalue = NULL;
if(name && !(tname = BUF_strdup(name))) goto err;
if(value && !(tvalue = BUF_strdup(value))) goto err;;
- if(!(vtmp = (CONF_VALUE *)Malloc(sizeof(CONF_VALUE)))) goto err;
+ if(!(vtmp = (CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_VALUE)))) goto err;
if(!*extlist && !(*extlist = sk_CONF_VALUE_new(NULL))) goto err;
vtmp->section = NULL;
vtmp->name = tname;
@@ -84,9 +84,9 @@ int X509V3_add_value(const char *name, const char *value,
return 1;
err:
X509V3err(X509V3_F_X509V3_ADD_VALUE,ERR_R_MALLOC_FAILURE);
- if(vtmp) Free(vtmp);
- if(tname) Free(tname);
- if(tvalue) Free(tvalue);
+ if(vtmp) OPENSSL_free(vtmp);
+ if(tname) OPENSSL_free(tname);
+ if(tvalue) OPENSSL_free(tvalue);
return 0;
}
@@ -101,10 +101,10 @@ int X509V3_add_value_uchar(const char *name, const unsigned char *value,
void X509V3_conf_free(CONF_VALUE *conf)
{
if(!conf) return;
- if(conf->name) Free(conf->name);
- if(conf->value) Free(conf->value);
- if(conf->section) Free(conf->section);
- Free(conf);
+ if(conf->name) OPENSSL_free(conf->name);
+ if(conf->value) OPENSSL_free(conf->value);
+ if(conf->section) OPENSSL_free(conf->section);
+ OPENSSL_free(conf);
}
int X509V3_add_value_bool(const char *name, int asn1_bool,
@@ -176,7 +176,7 @@ int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint,
if(!aint) return 1;
if(!(strtmp = i2s_ASN1_INTEGER(NULL, aint))) return 0;
ret = X509V3_add_value(name, strtmp, extlist);
- Free(strtmp);
+ OPENSSL_free(strtmp);
return ret;
}
@@ -298,11 +298,11 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(char *line)
}
X509V3_add_value(ntmp, NULL, &values);
}
-Free(linebuf);
+OPENSSL_free(linebuf);
return values;
err:
-Free(linebuf);
+OPENSSL_free(linebuf);
sk_CONF_VALUE_pop_free(values, X509V3_conf_free);
return NULL;
@@ -325,7 +325,7 @@ static char *strip_spaces(char *name)
/* hex string utilities */
-/* Given a buffer of length 'len' return a Malloc'ed string with its
+/* Given a buffer of length 'len' return a OPENSSL_malloc'ed string with its
* hex representation
*/
@@ -336,7 +336,7 @@ char *hex_to_string(unsigned char *buffer, long len)
int i;
static char hexdig[] = "0123456789ABCDEF";
if(!buffer || !len) return NULL;
- if(!(tmp = Malloc(len * 3 + 1))) {
+ if(!(tmp = OPENSSL_malloc(len * 3 + 1))) {
X509V3err(X509V3_F_HEX_TO_STRING,ERR_R_MALLOC_FAILURE);
return NULL;
}
@@ -362,14 +362,14 @@ unsigned char *string_to_hex(char *str, long *len)
X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_INVALID_NULL_ARGUMENT);
return NULL;
}
- if(!(hexbuf = Malloc(strlen(str) >> 1))) goto err;
+ if(!(hexbuf = OPENSSL_malloc(strlen(str) >> 1))) goto err;
for(p = (unsigned char *)str, q = hexbuf; *p;) {
ch = *p++;
if(ch == ':') continue;
cl = *p++;
if(!cl) {
X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_ODD_NUMBER_OF_DIGITS);
- Free(hexbuf);
+ OPENSSL_free(hexbuf);
return NULL;
}
if(isupper(ch)) ch = tolower(ch);
@@ -391,12 +391,12 @@ unsigned char *string_to_hex(char *str, long *len)
return hexbuf;
err:
- if(hexbuf) Free(hexbuf);
+ if(hexbuf) OPENSSL_free(hexbuf);
X509V3err(X509V3_F_STRING_TO_HEX,ERR_R_MALLOC_FAILURE);
return NULL;
badhex:
- Free(hexbuf);
+ OPENSSL_free(hexbuf);
X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_ILLEGAL_HEX_DIGIT);
return NULL;