sync with OpenBSD -current

This commit is contained in:
purplerain 2024-02-28 20:57:49 +00:00
parent 8d80bb2dde
commit 0f90c06c31
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
15 changed files with 176 additions and 142 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x509_purp.c,v 1.35 2024/01/07 16:22:46 tb Exp $ */
/* $OpenBSD: x509_purp.c,v 1.36 2024/02/28 16:26:08 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2001.
*/
@ -177,10 +177,12 @@ X509_check_purpose(X509 *x, int id, int ca)
if (id == -1)
return 1;
idx = X509_PURPOSE_get_by_id(id);
if (idx == -1)
if ((idx = X509_PURPOSE_get_by_id(id)) == -1)
return -1;
pt = X509_PURPOSE_get0(idx);
if ((pt = X509_PURPOSE_get0(idx)) == NULL)
return -1;
return pt->check_purpose(pt, x, ca);
}
LCRYPTO_ALIAS(X509_check_purpose);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: x509_vfy.c,v 1.140 2024/02/23 09:50:19 tb Exp $ */
/* $OpenBSD: x509_vfy.c,v 1.141 2024/02/28 12:21:16 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -2204,7 +2204,7 @@ X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose_id)
if (ctx->param->purpose == 0)
ctx->param->purpose = purpose_id;
if (ctx->param->trust == 0)
ctx->param->trust = purpose->trust;
ctx->param->trust = X509_PURPOSE_get_trust(purpose);
return 1;
}