Skip to content

Commit 37fcdfd

Browse files
botovqnebeid
authored andcommitted
Remove unused flags argument from trust handlers
AWS-LC: - X509_TRUST is in include/openssl/x509.h; the check_trust function pointer was changed there. Change-Id: Ie16e9ab0897305089672720efa4530d43074f692 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/67387 Auto-Submit: Theo Buehler <[email protected]> Reviewed-by: Bob Beck <[email protected]> Reviewed-by: David Benjamin <[email protected]> Commit-Queue: Bob Beck <[email protected]> (cherry picked from commit 4ac76f07a401b9b11d6ff305049721cfe3f6a777)
1 parent d9e7533 commit 37fcdfd

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

crypto/x509/x509_trs.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@
6666
#include "internal.h"
6767

6868

69-
static int trust_1oidany(const X509_TRUST *trust, X509 *x, int flags);
70-
static int trust_compat(const X509_TRUST *trust, X509 *x, int flags);
69+
static int trust_1oidany(const X509_TRUST *trust, X509 *x);
70+
static int trust_compat(const X509_TRUST *trust, X509 *x);
7171

72-
static int obj_trust(int id, X509 *x, int flags);
72+
static int obj_trust(int id, X509 *x);
7373

7474
static const X509_TRUST trstandard[] = {
7575
{X509_TRUST_COMPAT, 0, trust_compat, (char *)"compatible", 0, NULL},
@@ -90,18 +90,18 @@ int X509_check_trust(X509 *x, int id, int flags) {
9090
}
9191
// We get this as a default value
9292
if (id == 0) {
93-
int rv = obj_trust(NID_anyExtendedKeyUsage, x, 0);
93+
int rv = obj_trust(NID_anyExtendedKeyUsage, x);
9494
if (rv != X509_TRUST_UNTRUSTED) {
9595
return rv;
9696
}
97-
return trust_compat(NULL, x, 0);
97+
return trust_compat(NULL, x);
9898
}
9999
int idx = X509_TRUST_get_by_id(id);
100100
if (idx == -1) {
101-
return obj_trust(id, x, flags);
101+
return obj_trust(id, x);
102102
}
103103
const X509_TRUST *pt = X509_TRUST_get0(idx);
104-
return pt->check_trust(pt, x, flags);
104+
return pt->check_trust(pt, x);
105105
}
106106

107107
int X509_TRUST_get_count(void) { return OPENSSL_ARRAY_SIZE(trstandard); }
@@ -139,16 +139,16 @@ char *X509_TRUST_get0_name(const X509_TRUST *xp) { return xp->name; }
139139

140140
int X509_TRUST_get_trust(const X509_TRUST *xp) { return xp->trust; }
141141

142-
static int trust_1oidany(const X509_TRUST *trust, X509 *x, int flags) {
142+
static int trust_1oidany(const X509_TRUST *trust, X509 *x) {
143143
if (x->aux && (x->aux->trust || x->aux->reject)) {
144-
return obj_trust(trust->arg1, x, flags);
144+
return obj_trust(trust->arg1, x);
145145
}
146146
// we don't have any trust settings: for compatibility we return trusted
147147
// if it is self signed
148-
return trust_compat(trust, x, flags);
148+
return trust_compat(trust, x);
149149
}
150150

151-
static int trust_compat(const X509_TRUST *trust, X509 *x, int flags) {
151+
static int trust_compat(const X509_TRUST *trust, X509 *x) {
152152
if (!x509v3_cache_extensions(x)) {
153153
return X509_TRUST_UNTRUSTED;
154154
}
@@ -159,7 +159,7 @@ static int trust_compat(const X509_TRUST *trust, X509 *x, int flags) {
159159
}
160160
}
161161

162-
static int obj_trust(int id, X509 *x, int flags) {
162+
static int obj_trust(int id, X509 *x) {
163163
ASN1_OBJECT *obj;
164164
size_t i;
165165
X509_CERT_AUX *ax;

include/openssl/x509.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5070,7 +5070,7 @@ DECLARE_STACK_OF(DIST_POINT)
50705070
struct x509_trust_st {
50715071
int trust;
50725072
int flags;
5073-
int (*check_trust)(const X509_TRUST *, X509 *, int);
5073+
int (*check_trust)(const X509_TRUST *, X509 *);
50745074
char *name;
50755075
int arg1;
50765076
void *arg2;

0 commit comments

Comments
 (0)