-/* $OpenBSD: x509_set.c,v 1.25 2023/04/25 10:18:39 job Exp $ */
+/* $OpenBSD: x509_set.c,v 1.26 2023/06/23 08:00:28 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
ASN1_INTEGER *in;
if (x == NULL)
- return (0);
+ return 0;
in = x->cert_info->serialNumber;
if (in != serial) {
in = ASN1_INTEGER_dup(serial);
x->cert_info->serialNumber = in;
}
}
- return (in != NULL);
+ return in != NULL;
}
LCRYPTO_ALIAS(X509_set_serialNumber);
int
X509_set_issuer_name(X509 *x, X509_NAME *name)
{
- if ((x == NULL) || (x->cert_info == NULL))
- return (0);
+ if (x == NULL || x->cert_info == NULL)
+ return 0;
x->cert_info->enc.modified = 1;
- return (X509_NAME_set(&x->cert_info->issuer, name));
+ return X509_NAME_set(&x->cert_info->issuer, name);
}
LCRYPTO_ALIAS(X509_set_issuer_name);
X509_set_subject_name(X509 *x, X509_NAME *name)
{
if (x == NULL || x->cert_info == NULL)
- return (0);
+ return 0;
x->cert_info->enc.modified = 1;
- return (X509_NAME_set(&x->cert_info->subject, name));
+ return X509_NAME_set(&x->cert_info->subject, name);
}
LCRYPTO_ALIAS(X509_set_subject_name);
X509_getm_notBefore(const X509 *x)
{
if (x == NULL || x->cert_info == NULL || x->cert_info->validity == NULL)
- return (NULL);
+ return NULL;
return x->cert_info->validity->notBefore;
}
LCRYPTO_ALIAS(X509_getm_notBefore);
ASN1_TIME *in;
if (x == NULL || x->cert_info->validity == NULL)
- return (0);
+ return 0;
in = x->cert_info->validity->notBefore;
if (in != tm) {
in = ASN1_STRING_dup(tm);
x->cert_info->validity->notBefore = in;
}
}
- return (in != NULL);
+ return in != NULL;
}
LCRYPTO_ALIAS(X509_set_notBefore);
X509_getm_notAfter(const X509 *x)
{
if (x == NULL || x->cert_info == NULL || x->cert_info->validity == NULL)
- return (NULL);
+ return NULL;
return x->cert_info->validity->notAfter;
}
LCRYPTO_ALIAS(X509_getm_notAfter);
ASN1_TIME *in;
if (x == NULL || x->cert_info->validity == NULL)
- return (0);
+ return 0;
in = x->cert_info->validity->notAfter;
if (in != tm) {
in = ASN1_STRING_dup(tm);
x->cert_info->validity->notAfter = in;
}
}
- return (in != NULL);
+ return in != NULL;
}
LCRYPTO_ALIAS(X509_set_notAfter);
int
X509_set_pubkey(X509 *x, EVP_PKEY *pkey)
{
- if ((x == NULL) || (x->cert_info == NULL))
- return (0);
+ if (x == NULL || x->cert_info == NULL)
+ return 0;
x->cert_info->enc.modified = 1;
- return (X509_PUBKEY_set(&(x->cert_info->key), pkey));
+ return X509_PUBKEY_set(&x->cert_info->key, pkey);
}
LCRYPTO_ALIAS(X509_set_pubkey);