diff options
| author | beck <> | 2017-01-29 17:49:23 +0000 |
|---|---|---|
| committer | beck <> | 2017-01-29 17:49:23 +0000 |
| commit | d1f47bd292f36094480caa49ada36b99a69c59b0 (patch) | |
| tree | 1a54abba678898ee5270ae4f3404a50ee9a92eea /src/lib/libcrypto/x509v3/v3_purp.c | |
| parent | f8c627888330b75c2eea8a3c27d0efe947a4f9da (diff) | |
| download | openbsd-d1f47bd292f36094480caa49ada36b99a69c59b0.tar.gz openbsd-d1f47bd292f36094480caa49ada36b99a69c59b0.tar.bz2 openbsd-d1f47bd292f36094480caa49ada36b99a69c59b0.zip | |
Send the function codes from the error functions to the bit bucket,
as was done earlier in libssl. Thanks inoguchi@ for noticing
libssl had more reacharounds into this.
ok jsing@ inoguchi@
Diffstat (limited to 'src/lib/libcrypto/x509v3/v3_purp.c')
| -rw-r--r-- | src/lib/libcrypto/x509v3/v3_purp.c | 12 |
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 | |||
| 138 | X509_PURPOSE_set(int *p, int purpose) | 138 | X509_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 | ||
