summaryrefslogtreecommitdiffstats
path: root/crypto/x509/x509_set.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2015-09-16 18:40:26 +0100
committerDr. Stephen Henson <steve@openssl.org>2015-09-16 22:33:25 +0100
commit5cf6abd805b9f15127f9f343a6e3b662565f93d5 (patch)
treec2200abe313b593158feb34a2a3c6f5ec8498dbc /crypto/x509/x509_set.c
parent7aef39a72a2d3a7a2b0e222137a45e1b1406668d (diff)
Embed X509_CINF
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/x509/x509_set.c')
-rw-r--r--crypto/x509/x509_set.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/crypto/x509/x509_set.c b/crypto/x509/x509_set.c
index 0b0d4f5ab8..b5209f23cd 100644
--- a/crypto/x509/x509_set.c
+++ b/crypto/x509/x509_set.c
@@ -68,15 +68,15 @@ int X509_set_version(X509 *x, long version)
if (x == NULL)
return (0);
if (version == 0) {
- ASN1_INTEGER_free(x->cert_info->version);
- x->cert_info->version = NULL;
+ ASN1_INTEGER_free(x->cert_info.version);
+ x->cert_info.version = NULL;
return (1);
}
- if (x->cert_info->version == NULL) {
- if ((x->cert_info->version = ASN1_INTEGER_new()) == NULL)
+ if (x->cert_info.version == NULL) {
+ if ((x->cert_info.version = ASN1_INTEGER_new()) == NULL)
return (0);
}
- return (ASN1_INTEGER_set(x->cert_info->version, version));
+ return (ASN1_INTEGER_set(x->cert_info.version, version));
}
int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial)
@@ -85,12 +85,12 @@ int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial)
if (x == NULL)
return (0);
- in = x->cert_info->serialNumber;
+ in = x->cert_info.serialNumber;
if (in != serial) {
in = ASN1_INTEGER_dup(serial);
if (in != NULL) {
- ASN1_INTEGER_free(x->cert_info->serialNumber);
- x->cert_info->serialNumber = in;
+ ASN1_INTEGER_free(x->cert_info.serialNumber);
+ x->cert_info.serialNumber = in;
}
}
return (in != NULL);
@@ -98,16 +98,16 @@ int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial)
int X509_set_issuer_name(X509 *x, X509_NAME *name)
{
- if ((x == NULL) || (x->cert_info == NULL))
+ if (x == NULL)
return (0);
- return (X509_NAME_set(&x->cert_info->issuer, name));
+ return (X509_NAME_set(&x->cert_info.issuer, name));
}
int X509_set_subject_name(X509 *x, X509_NAME *name)
{
- if ((x == NULL) || (x->cert_info == NULL))
+ if (x == NULL)
return (0);
- return (X509_NAME_set(&x->cert_info->subject, name));
+ return (X509_NAME_set(&x->cert_info.subject, name));
}
int X509_set_notBefore(X509 *x, const ASN1_TIME *tm)
@@ -116,12 +116,12 @@ int X509_set_notBefore(X509 *x, const ASN1_TIME *tm)
if (x == NULL)
return (0);
- in = x->cert_info->validity.notBefore;
+ in = x->cert_info.validity.notBefore;
if (in != tm) {
in = ASN1_STRING_dup(tm);
if (in != NULL) {
- ASN1_TIME_free(x->cert_info->validity.notBefore);
- x->cert_info->validity.notBefore = in;
+ ASN1_TIME_free(x->cert_info.validity.notBefore);
+ x->cert_info.validity.notBefore = in;
}
}
return (in != NULL);
@@ -133,12 +133,12 @@ int X509_set_notAfter(X509 *x, const ASN1_TIME *tm)
if (x == NULL)
return (0);
- in = x->cert_info->validity.notAfter;
+ in = x->cert_info.validity.notAfter;
if (in != tm) {
in = ASN1_STRING_dup(tm);
if (in != NULL) {
- ASN1_TIME_free(x->cert_info->validity.notAfter);
- x->cert_info->validity.notAfter = in;
+ ASN1_TIME_free(x->cert_info.validity.notAfter);
+ x->cert_info.validity.notAfter = in;
}
}
return (in != NULL);
@@ -146,9 +146,9 @@ int X509_set_notAfter(X509 *x, const ASN1_TIME *tm)
int X509_set_pubkey(X509 *x, EVP_PKEY *pkey)
{
- if ((x == NULL) || (x->cert_info == NULL))
+ if (x == NULL)
return (0);
- return (X509_PUBKEY_set(&(x->cert_info->key), pkey));
+ return (X509_PUBKEY_set(&(x->cert_info.key), pkey));
}
void X509_up_ref(X509 *x)
@@ -158,17 +158,17 @@ void X509_up_ref(X509 *x)
long X509_get_version(X509 *x)
{
- return ASN1_INTEGER_get(x->cert_info->version);
+ return ASN1_INTEGER_get(x->cert_info.version);
}
ASN1_TIME * X509_get_notBefore(X509 *x)
{
- return x->cert_info->validity.notBefore;
+ return x->cert_info.validity.notBefore;
}
ASN1_TIME *X509_get_notAfter(X509 *x)
{
- return x->cert_info->validity.notAfter;
+ return x->cert_info.validity.notAfter;
}
int X509_get_signature_type(const X509 *x)
@@ -178,5 +178,5 @@ int X509_get_signature_type(const X509 *x)
X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x)
{
- return x->cert_info->key;
+ return x->cert_info.key;
}