summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509v3/v3_purp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509v3/v3_purp.c')
-rw-r--r--src/lib/libcrypto/x509v3/v3_purp.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_purp.c b/src/lib/libcrypto/x509v3/v3_purp.c
index d8ab679304..bdcdf95d12 100644
--- a/src/lib/libcrypto/x509v3/v3_purp.c
+++ b/src/lib/libcrypto/x509v3/v3_purp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_purp.c,v 1.28 2017/01/21 04:42:16 jsing Exp $ */ 1/* $OpenBSD: v3_purp.c,v 1.29 2017/01/29 17:49:23 beck Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -138,7 +138,7 @@ int
138X509_PURPOSE_set(int *p, int purpose) 138X509_PURPOSE_set(int *p, int purpose)
139{ 139{
140 if (X509_PURPOSE_get_by_id(purpose) == -1) { 140 if (X509_PURPOSE_get_by_id(purpose) == -1) {
141 X509V3err(X509V3_F_X509_PURPOSE_SET, X509V3_R_INVALID_PURPOSE); 141 X509V3error(X509V3_R_INVALID_PURPOSE);
142 return 0; 142 return 0;
143 } 143 }
144 *p = purpose; 144 *p = purpose;
@@ -206,8 +206,7 @@ X509_PURPOSE_add(int id, int trust, int flags,
206 name_dup = sname_dup = NULL; 206 name_dup = sname_dup = NULL;
207 207
208 if (name == NULL || sname == NULL) { 208 if (name == NULL || sname == NULL) {
209 X509V3err(X509V3_F_X509_PURPOSE_ADD, 209 X509V3error(X509V3_R_INVALID_NULL_ARGUMENT);
210 X509V3_R_INVALID_NULL_ARGUMENT);
211 return 0; 210 return 0;
212 } 211 }
213 212
@@ -220,8 +219,7 @@ X509_PURPOSE_add(int id, int trust, int flags,
220 /* Need a new entry */ 219 /* Need a new entry */
221 if (idx == -1) { 220 if (idx == -1) {
222 if ((ptmp = malloc(sizeof(X509_PURPOSE))) == NULL) { 221 if ((ptmp = malloc(sizeof(X509_PURPOSE))) == NULL) {
223 X509V3err(X509V3_F_X509_PURPOSE_ADD, 222 X509V3error(ERR_R_MALLOC_FAILURE);
224 ERR_R_MALLOC_FAILURE);
225 return 0; 223 return 0;
226 } 224 }
227 ptmp->flags = X509_PURPOSE_DYNAMIC; 225 ptmp->flags = X509_PURPOSE_DYNAMIC;
@@ -266,7 +264,7 @@ err:
266 free(sname_dup); 264 free(sname_dup);
267 if (idx == -1) 265 if (idx == -1)
268 free(ptmp); 266 free(ptmp);
269 X509V3err(X509V3_F_X509_PURPOSE_ADD, ERR_R_MALLOC_FAILURE); 267 X509V3error(ERR_R_MALLOC_FAILURE);
270 return 0; 268 return 0;
271} 269}
272 270