diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_set.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/libcrypto/x509/x509_set.c b/src/lib/libcrypto/x509/x509_set.c index cd12c9ec2f..b56d30aec5 100644 --- a/src/lib/libcrypto/x509/x509_set.c +++ b/src/lib/libcrypto/x509/x509_set.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_set.c,v 1.25 2023/04/25 10:18:39 job Exp $ */ | 1 | /* $OpenBSD: x509_set.c,v 1.26 2023/06/23 08:00:28 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -106,7 +106,7 @@ X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) | |||
| 106 | ASN1_INTEGER *in; | 106 | ASN1_INTEGER *in; |
| 107 | 107 | ||
| 108 | if (x == NULL) | 108 | if (x == NULL) |
| 109 | return (0); | 109 | return 0; |
| 110 | in = x->cert_info->serialNumber; | 110 | in = x->cert_info->serialNumber; |
| 111 | if (in != serial) { | 111 | if (in != serial) { |
| 112 | in = ASN1_INTEGER_dup(serial); | 112 | in = ASN1_INTEGER_dup(serial); |
| @@ -116,17 +116,17 @@ X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) | |||
| 116 | x->cert_info->serialNumber = in; | 116 | x->cert_info->serialNumber = in; |
| 117 | } | 117 | } |
| 118 | } | 118 | } |
| 119 | return (in != NULL); | 119 | return in != NULL; |
| 120 | } | 120 | } |
| 121 | LCRYPTO_ALIAS(X509_set_serialNumber); | 121 | LCRYPTO_ALIAS(X509_set_serialNumber); |
| 122 | 122 | ||
| 123 | int | 123 | int |
| 124 | X509_set_issuer_name(X509 *x, X509_NAME *name) | 124 | X509_set_issuer_name(X509 *x, X509_NAME *name) |
| 125 | { | 125 | { |
| 126 | if ((x == NULL) || (x->cert_info == NULL)) | 126 | if (x == NULL || x->cert_info == NULL) |
| 127 | return (0); | 127 | return 0; |
| 128 | x->cert_info->enc.modified = 1; | 128 | x->cert_info->enc.modified = 1; |
| 129 | return (X509_NAME_set(&x->cert_info->issuer, name)); | 129 | return X509_NAME_set(&x->cert_info->issuer, name); |
| 130 | } | 130 | } |
| 131 | LCRYPTO_ALIAS(X509_set_issuer_name); | 131 | LCRYPTO_ALIAS(X509_set_issuer_name); |
| 132 | 132 | ||
| @@ -134,9 +134,9 @@ int | |||
| 134 | X509_set_subject_name(X509 *x, X509_NAME *name) | 134 | X509_set_subject_name(X509 *x, X509_NAME *name) |
| 135 | { | 135 | { |
| 136 | if (x == NULL || x->cert_info == NULL) | 136 | if (x == NULL || x->cert_info == NULL) |
| 137 | return (0); | 137 | return 0; |
| 138 | x->cert_info->enc.modified = 1; | 138 | x->cert_info->enc.modified = 1; |
| 139 | return (X509_NAME_set(&x->cert_info->subject, name)); | 139 | return X509_NAME_set(&x->cert_info->subject, name); |
| 140 | } | 140 | } |
| 141 | LCRYPTO_ALIAS(X509_set_subject_name); | 141 | LCRYPTO_ALIAS(X509_set_subject_name); |
| 142 | 142 | ||
| @@ -151,7 +151,7 @@ ASN1_TIME * | |||
| 151 | X509_getm_notBefore(const X509 *x) | 151 | X509_getm_notBefore(const X509 *x) |
| 152 | { | 152 | { |
| 153 | if (x == NULL || x->cert_info == NULL || x->cert_info->validity == NULL) | 153 | if (x == NULL || x->cert_info == NULL || x->cert_info->validity == NULL) |
| 154 | return (NULL); | 154 | return NULL; |
| 155 | return x->cert_info->validity->notBefore; | 155 | return x->cert_info->validity->notBefore; |
| 156 | } | 156 | } |
| 157 | LCRYPTO_ALIAS(X509_getm_notBefore); | 157 | LCRYPTO_ALIAS(X509_getm_notBefore); |
| @@ -162,7 +162,7 @@ X509_set_notBefore(X509 *x, const ASN1_TIME *tm) | |||
| 162 | ASN1_TIME *in; | 162 | ASN1_TIME *in; |
| 163 | 163 | ||
| 164 | if (x == NULL || x->cert_info->validity == NULL) | 164 | if (x == NULL || x->cert_info->validity == NULL) |
| 165 | return (0); | 165 | return 0; |
| 166 | in = x->cert_info->validity->notBefore; | 166 | in = x->cert_info->validity->notBefore; |
| 167 | if (in != tm) { | 167 | if (in != tm) { |
| 168 | in = ASN1_STRING_dup(tm); | 168 | in = ASN1_STRING_dup(tm); |
| @@ -172,7 +172,7 @@ X509_set_notBefore(X509 *x, const ASN1_TIME *tm) | |||
| 172 | x->cert_info->validity->notBefore = in; | 172 | x->cert_info->validity->notBefore = in; |
| 173 | } | 173 | } |
| 174 | } | 174 | } |
| 175 | return (in != NULL); | 175 | return in != NULL; |
| 176 | } | 176 | } |
| 177 | LCRYPTO_ALIAS(X509_set_notBefore); | 177 | LCRYPTO_ALIAS(X509_set_notBefore); |
| 178 | 178 | ||
| @@ -194,7 +194,7 @@ ASN1_TIME * | |||
| 194 | X509_getm_notAfter(const X509 *x) | 194 | X509_getm_notAfter(const X509 *x) |
| 195 | { | 195 | { |
| 196 | if (x == NULL || x->cert_info == NULL || x->cert_info->validity == NULL) | 196 | if (x == NULL || x->cert_info == NULL || x->cert_info->validity == NULL) |
| 197 | return (NULL); | 197 | return NULL; |
| 198 | return x->cert_info->validity->notAfter; | 198 | return x->cert_info->validity->notAfter; |
| 199 | } | 199 | } |
| 200 | LCRYPTO_ALIAS(X509_getm_notAfter); | 200 | LCRYPTO_ALIAS(X509_getm_notAfter); |
| @@ -205,7 +205,7 @@ X509_set_notAfter(X509 *x, const ASN1_TIME *tm) | |||
| 205 | ASN1_TIME *in; | 205 | ASN1_TIME *in; |
| 206 | 206 | ||
| 207 | if (x == NULL || x->cert_info->validity == NULL) | 207 | if (x == NULL || x->cert_info->validity == NULL) |
| 208 | return (0); | 208 | return 0; |
| 209 | in = x->cert_info->validity->notAfter; | 209 | in = x->cert_info->validity->notAfter; |
| 210 | if (in != tm) { | 210 | if (in != tm) { |
| 211 | in = ASN1_STRING_dup(tm); | 211 | in = ASN1_STRING_dup(tm); |
| @@ -215,7 +215,7 @@ X509_set_notAfter(X509 *x, const ASN1_TIME *tm) | |||
| 215 | x->cert_info->validity->notAfter = in; | 215 | x->cert_info->validity->notAfter = in; |
| 216 | } | 216 | } |
| 217 | } | 217 | } |
| 218 | return (in != NULL); | 218 | return in != NULL; |
| 219 | } | 219 | } |
| 220 | LCRYPTO_ALIAS(X509_set_notAfter); | 220 | LCRYPTO_ALIAS(X509_set_notAfter); |
| 221 | 221 | ||
| @@ -229,10 +229,10 @@ LCRYPTO_ALIAS(X509_set1_notAfter); | |||
| 229 | int | 229 | int |
| 230 | X509_set_pubkey(X509 *x, EVP_PKEY *pkey) | 230 | X509_set_pubkey(X509 *x, EVP_PKEY *pkey) |
| 231 | { | 231 | { |
| 232 | if ((x == NULL) || (x->cert_info == NULL)) | 232 | if (x == NULL || x->cert_info == NULL) |
| 233 | return (0); | 233 | return 0; |
| 234 | x->cert_info->enc.modified = 1; | 234 | x->cert_info->enc.modified = 1; |
| 235 | return (X509_PUBKEY_set(&(x->cert_info->key), pkey)); | 235 | return X509_PUBKEY_set(&x->cert_info->key, pkey); |
| 236 | } | 236 | } |
| 237 | LCRYPTO_ALIAS(X509_set_pubkey); | 237 | LCRYPTO_ALIAS(X509_set_pubkey); |
| 238 | 238 | ||
