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/x509/x509_trs.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/x509/x509_trs.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_trs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/x509/x509_trs.c b/src/lib/libcrypto/x509/x509_trs.c index 5be7abdf08..9af74de1ca 100644 --- a/src/lib/libcrypto/x509/x509_trs.c +++ b/src/lib/libcrypto/x509/x509_trs.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_trs.c,v 1.21 2016/11/06 10:31:34 beck Exp $ */ | 1 | /* $OpenBSD: x509_trs.c,v 1.22 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 1999. | 3 | * project 1999. |
| 4 | */ | 4 | */ |
| @@ -178,7 +178,7 @@ int | |||
| 178 | X509_TRUST_set(int *t, int trust) | 178 | X509_TRUST_set(int *t, int trust) |
| 179 | { | 179 | { |
| 180 | if (X509_TRUST_get_by_id(trust) == -1) { | 180 | if (X509_TRUST_get_by_id(trust) == -1) { |
| 181 | X509err(X509_F_X509_TRUST_SET, X509_R_INVALID_TRUST); | 181 | X509error(X509_R_INVALID_TRUST); |
| 182 | return 0; | 182 | return 0; |
| 183 | } | 183 | } |
| 184 | *t = trust; | 184 | *t = trust; |
| @@ -202,14 +202,14 @@ X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), | |||
| 202 | /* Need a new entry */ | 202 | /* Need a new entry */ |
| 203 | if (idx == -1) { | 203 | if (idx == -1) { |
| 204 | if (!(trtmp = malloc(sizeof(X509_TRUST)))) { | 204 | if (!(trtmp = malloc(sizeof(X509_TRUST)))) { |
| 205 | X509err(X509_F_X509_TRUST_ADD, ERR_R_MALLOC_FAILURE); | 205 | X509error(ERR_R_MALLOC_FAILURE); |
| 206 | return 0; | 206 | return 0; |
| 207 | } | 207 | } |
| 208 | trtmp->flags = X509_TRUST_DYNAMIC; | 208 | trtmp->flags = X509_TRUST_DYNAMIC; |
| 209 | } else { | 209 | } else { |
| 210 | trtmp = X509_TRUST_get0(idx); | 210 | trtmp = X509_TRUST_get0(idx); |
| 211 | if (trtmp == NULL) { | 211 | if (trtmp == NULL) { |
| 212 | X509err(X509_F_X509_TRUST_ADD, X509_R_INVALID_TRUST); | 212 | X509error(X509_R_INVALID_TRUST); |
| 213 | return 0; | 213 | return 0; |
| 214 | } | 214 | } |
| 215 | } | 215 | } |
| @@ -246,7 +246,7 @@ err: | |||
| 246 | free(name_dup); | 246 | free(name_dup); |
| 247 | if (idx == -1) | 247 | if (idx == -1) |
| 248 | free(trtmp); | 248 | free(trtmp); |
| 249 | X509err(X509_F_X509_TRUST_ADD, ERR_R_MALLOC_FAILURE); | 249 | X509error(ERR_R_MALLOC_FAILURE); |
| 250 | return 0; | 250 | return 0; |
| 251 | } | 251 | } |
| 252 | 252 | ||
