summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_trs.c
diff options
context:
space:
mode:
authorbeck <>2017-01-29 17:49:23 +0000
committerbeck <>2017-01-29 17:49:23 +0000
commit957b11334a7afb14537322f0e4795b2e368b3f59 (patch)
tree1a54abba678898ee5270ae4f3404a50ee9a92eea /src/lib/libcrypto/x509/x509_trs.c
parentdf96e020e729c6c37a8c7fe311fdd1fe6a8718c5 (diff)
downloadopenbsd-957b11334a7afb14537322f0e4795b2e368b3f59.tar.gz
openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.tar.bz2
openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.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.c10
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
178X509_TRUST_set(int *t, int trust) 178X509_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