mirror of
https://github.com/ipxe/ipxe
synced 2026-04-16 03:00:10 +03:00
[crypto] Add x509_is_self_signed() helper function
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -374,6 +374,16 @@ x509_root_put ( struct x509_root *root ) {
|
||||
ref_put ( &root->refcnt );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if X.509 certificate is self-signed
|
||||
*
|
||||
* @v cert X.509 certificate
|
||||
* @ret is_self_signed X.509 certificate is self-signed
|
||||
*/
|
||||
static inline int x509_is_self_signed ( struct x509_certificate *cert ) {
|
||||
return ( asn1_compare ( &cert->issuer.raw, &cert->subject.raw ) == 0 );
|
||||
}
|
||||
|
||||
extern const char * x509_name ( struct x509_certificate *cert );
|
||||
extern int x509_parse ( struct x509_certificate *cert,
|
||||
const struct asn1_cursor *raw );
|
||||
|
||||
Reference in New Issue
Block a user