Skip to content

Commit 25d8c64

Browse files
committed
x509_get_purpose: check EXFLAG_SI and EXFLAG_SS for EE certs
ok claudio
1 parent db44605 commit 25d8c64

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

usr.sbin/rpki-client/x509.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: x509.c,v 1.105 2024/12/03 14:51:09 job Exp $ */
1+
/* $OpenBSD: x509.c,v 1.106 2025/06/19 06:46:56 tb Exp $ */
22
/*
33
* Copyright (c) 2022 Theo Buehler <[email protected]>
44
* Copyright (c) 2021 Claudio Jeker <[email protected]>
@@ -364,6 +364,11 @@ x509_get_purpose(X509 *x, const char *fn)
364364
goto out;
365365
}
366366

367+
if ((ext_flags & (EXFLAG_SI | EXFLAG_SS)) != 0) {
368+
warnx("%s: EE cert must not be self-issued or self-signed", fn);
369+
goto out;
370+
}
371+
367372
if (X509_get_key_usage(x) != KU_DIGITAL_SIGNATURE) {
368373
warnx("%s: RFC 6487 section 4.8.4: KU must be digitalSignature",
369374
fn);

0 commit comments

Comments
 (0)