summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_set.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509/x509_set.c')
-rw-r--r--src/lib/libcrypto/x509/x509_set.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_set.c b/src/lib/libcrypto/x509/x509_set.c
index 5784f2203e..91d6483a3b 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.20 2021/11/01 20:53:08 tb Exp $ */ 1/* $OpenBSD: x509_set.c,v 1.21 2022/11/14 17:48:50 beck 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 *
@@ -70,12 +70,14 @@ X509_get0_extensions(const X509 *x)
70{ 70{
71 return x->cert_info->extensions; 71 return x->cert_info->extensions;
72} 72}
73LCRYPTO_ALIAS(X509_get0_extensions)
73 74
74const X509_ALGOR * 75const X509_ALGOR *
75X509_get0_tbs_sigalg(const X509 *x) 76X509_get0_tbs_sigalg(const X509 *x)
76{ 77{
77 return x->cert_info->signature; 78 return x->cert_info->signature;
78} 79}
80LCRYPTO_ALIAS(X509_get0_tbs_sigalg)
79 81
80int 82int
81X509_set_version(X509 *x, long version) 83X509_set_version(X509 *x, long version)
@@ -88,12 +90,14 @@ X509_set_version(X509 *x, long version)
88 } 90 }
89 return (ASN1_INTEGER_set(x->cert_info->version, version)); 91 return (ASN1_INTEGER_set(x->cert_info->version, version));
90} 92}
93LCRYPTO_ALIAS(X509_set_version)
91 94
92long 95long
93X509_get_version(const X509 *x) 96X509_get_version(const X509 *x)
94{ 97{
95 return ASN1_INTEGER_get(x->cert_info->version); 98 return ASN1_INTEGER_get(x->cert_info->version);
96} 99}
100LCRYPTO_ALIAS(X509_get_version)
97 101
98int 102int
99X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) 103X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial)
@@ -112,6 +116,7 @@ X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial)
112 } 116 }
113 return (in != NULL); 117 return (in != NULL);
114} 118}
119LCRYPTO_ALIAS(X509_set_serialNumber)
115 120
116int 121int
117X509_set_issuer_name(X509 *x, X509_NAME *name) 122X509_set_issuer_name(X509 *x, X509_NAME *name)
@@ -120,6 +125,7 @@ X509_set_issuer_name(X509 *x, X509_NAME *name)
120 return (0); 125 return (0);
121 return (X509_NAME_set(&x->cert_info->issuer, name)); 126 return (X509_NAME_set(&x->cert_info->issuer, name));
122} 127}
128LCRYPTO_ALIAS(X509_set_issuer_name)
123 129
124int 130int
125X509_set_subject_name(X509 *x, X509_NAME *name) 131X509_set_subject_name(X509 *x, X509_NAME *name)
@@ -128,12 +134,14 @@ X509_set_subject_name(X509 *x, X509_NAME *name)
128 return (0); 134 return (0);
129 return (X509_NAME_set(&x->cert_info->subject, name)); 135 return (X509_NAME_set(&x->cert_info->subject, name));
130} 136}
137LCRYPTO_ALIAS(X509_set_subject_name)
131 138
132const ASN1_TIME * 139const ASN1_TIME *
133X509_get0_notBefore(const X509 *x) 140X509_get0_notBefore(const X509 *x)
134{ 141{
135 return X509_getm_notBefore(x); 142 return X509_getm_notBefore(x);
136} 143}
144LCRYPTO_ALIAS(X509_get0_notBefore)
137 145
138ASN1_TIME * 146ASN1_TIME *
139X509_getm_notBefore(const X509 *x) 147X509_getm_notBefore(const X509 *x)
@@ -142,6 +150,7 @@ X509_getm_notBefore(const X509 *x)
142 return (NULL); 150 return (NULL);
143 return x->cert_info->validity->notBefore; 151 return x->cert_info->validity->notBefore;
144} 152}
153LCRYPTO_ALIAS(X509_getm_notBefore)
145 154
146int 155int
147X509_set_notBefore(X509 *x, const ASN1_TIME *tm) 156X509_set_notBefore(X509 *x, const ASN1_TIME *tm)
@@ -160,18 +169,21 @@ X509_set_notBefore(X509 *x, const ASN1_TIME *tm)
160 } 169 }
161 return (in != NULL); 170 return (in != NULL);
162} 171}
172LCRYPTO_ALIAS(X509_set_notBefore)
163 173
164int 174int
165X509_set1_notBefore(X509 *x, const ASN1_TIME *tm) 175X509_set1_notBefore(X509 *x, const ASN1_TIME *tm)
166{ 176{
167 return X509_set_notBefore(x, tm); 177 return X509_set_notBefore(x, tm);
168} 178}
179LCRYPTO_ALIAS(X509_set1_notBefore)
169 180
170const ASN1_TIME * 181const ASN1_TIME *
171X509_get0_notAfter(const X509 *x) 182X509_get0_notAfter(const X509 *x)
172{ 183{
173 return X509_getm_notAfter(x); 184 return X509_getm_notAfter(x);
174} 185}
186LCRYPTO_ALIAS(X509_get0_notAfter)
175 187
176ASN1_TIME * 188ASN1_TIME *
177X509_getm_notAfter(const X509 *x) 189X509_getm_notAfter(const X509 *x)
@@ -180,6 +192,7 @@ X509_getm_notAfter(const X509 *x)
180 return (NULL); 192 return (NULL);
181 return x->cert_info->validity->notAfter; 193 return x->cert_info->validity->notAfter;
182} 194}
195LCRYPTO_ALIAS(X509_getm_notAfter)
183 196
184int 197int
185X509_set_notAfter(X509 *x, const ASN1_TIME *tm) 198X509_set_notAfter(X509 *x, const ASN1_TIME *tm)
@@ -198,12 +211,14 @@ X509_set_notAfter(X509 *x, const ASN1_TIME *tm)
198 } 211 }
199 return (in != NULL); 212 return (in != NULL);
200} 213}
214LCRYPTO_ALIAS(X509_set_notAfter)
201 215
202int 216int
203X509_set1_notAfter(X509 *x, const ASN1_TIME *tm) 217X509_set1_notAfter(X509 *x, const ASN1_TIME *tm)
204{ 218{
205 return X509_set_notAfter(x, tm); 219 return X509_set_notAfter(x, tm);
206} 220}
221LCRYPTO_ALIAS(X509_set1_notAfter)
207 222
208int 223int
209X509_set_pubkey(X509 *x, EVP_PKEY *pkey) 224X509_set_pubkey(X509 *x, EVP_PKEY *pkey)
@@ -212,15 +227,18 @@ X509_set_pubkey(X509 *x, EVP_PKEY *pkey)
212 return (0); 227 return (0);
213 return (X509_PUBKEY_set(&(x->cert_info->key), pkey)); 228 return (X509_PUBKEY_set(&(x->cert_info->key), pkey));
214} 229}
230LCRYPTO_ALIAS(X509_set_pubkey)
215 231
216int 232int
217X509_get_signature_type(const X509 *x) 233X509_get_signature_type(const X509 *x)
218{ 234{
219 return EVP_PKEY_type(OBJ_obj2nid(x->sig_alg->algorithm)); 235 return EVP_PKEY_type(OBJ_obj2nid(x->sig_alg->algorithm));
220} 236}
237LCRYPTO_ALIAS(X509_get_signature_type)
221 238
222X509_PUBKEY * 239X509_PUBKEY *
223X509_get_X509_PUBKEY(const X509 *x) 240X509_get_X509_PUBKEY(const X509 *x)
224{ 241{
225 return x->cert_info->key; 242 return x->cert_info->key;
226} 243}
244LCRYPTO_ALIAS(X509_get_X509_PUBKEY)