Replace the macros in asn1.h with function equivalents. Also make UTF8Strings

tolerated in certificates.
This commit is contained in:
Dr. Stephen Henson
1999-10-20 01:50:23 +00:00
parent 023c8d0b0a
commit 08e9c1af6c
87 changed files with 594 additions and 387 deletions

View File

@@ -273,7 +273,7 @@ static int copy_email(X509V3_CTX *ctx, STACK_OF(GENERAL_NAME) *gens)
while((i = X509_NAME_get_index_by_NID(nm,
NID_pkcs9_emailAddress, i)) > 0) {
ne = X509_NAME_get_entry(nm, i);
email = ASN1_IA5STRING_dup(X509_NAME_ENTRY_get_data(ne));
email = M_ASN1_IA5STRING_dup(X509_NAME_ENTRY_get_data(ne));
if(!email || !(gen = GENERAL_NAME_new())) {
X509V3err(X509V3_F_COPY_EMAIL,ERR_R_MALLOC_FAILURE);
goto err;
@@ -293,7 +293,7 @@ static int copy_email(X509V3_CTX *ctx, STACK_OF(GENERAL_NAME) *gens)
err:
GENERAL_NAME_free(gen);
ASN1_IA5STRING_free(email);
M_ASN1_IA5STRING_free(email);
return 0;
}
@@ -371,7 +371,7 @@ if(!name_cmp(name, "email")) {
goto err;
}
ip[0] = i1; ip[1] = i2 ; ip[2] = i3 ; ip[3] = i4;
if(!(gen->d.ip = ASN1_OCTET_STRING_new()) ||
if(!(gen->d.ip = M_ASN1_OCTET_STRING_new()) ||
!ASN1_STRING_set(gen->d.ip, ip, 4)) {
X509V3err(X509V3_F_V2I_GENERAL_NAME,ERR_R_MALLOC_FAILURE);
goto err;
@@ -384,7 +384,7 @@ if(!name_cmp(name, "email")) {
}
if(is_string) {
if(!(gen->d.ia5 = ASN1_IA5STRING_new()) ||
if(!(gen->d.ia5 = M_ASN1_IA5STRING_new()) ||
!ASN1_STRING_set(gen->d.ia5, (unsigned char*)value,
strlen(value))) {
X509V3err(X509V3_F_V2I_GENERAL_NAME,ERR_R_MALLOC_FAILURE);