0001
0002
0003
0004
0005
0006
0007
0008 #include <linux/time.h>
0009 #include <crypto/public_key.h>
0010 #include <keys/asymmetric-type.h>
0011
0012 struct x509_certificate {
0013 struct x509_certificate *next;
0014 struct x509_certificate *signer;
0015 struct public_key *pub;
0016 struct public_key_signature *sig;
0017 char *issuer;
0018 char *subject;
0019 struct asymmetric_key_id *id;
0020 struct asymmetric_key_id *skid;
0021 time64_t valid_from;
0022 time64_t valid_to;
0023 const void *tbs;
0024 unsigned tbs_size;
0025 unsigned raw_sig_size;
0026 const void *raw_sig;
0027 const void *raw_serial;
0028 unsigned raw_serial_size;
0029 unsigned raw_issuer_size;
0030 const void *raw_issuer;
0031 const void *raw_subject;
0032 unsigned raw_subject_size;
0033 unsigned raw_skid_size;
0034 const void *raw_skid;
0035 unsigned index;
0036 bool seen;
0037 bool verified;
0038 bool self_signed;
0039 bool unsupported_sig;
0040 bool blacklisted;
0041 };
0042
0043
0044
0045
0046 #ifdef CONFIG_FIPS_SIGNATURE_SELFTEST
0047 extern int __init fips_signature_selftest(void);
0048 #else
0049 static inline int fips_signature_selftest(void) { return 0; }
0050 #endif
0051
0052
0053
0054
0055 extern void x509_free_certificate(struct x509_certificate *cert);
0056 extern struct x509_certificate *x509_cert_parse(const void *data, size_t datalen);
0057 extern int x509_decode_time(time64_t *_t, size_t hdrlen,
0058 unsigned char tag,
0059 const unsigned char *value, size_t vlen);
0060
0061
0062
0063
0064 extern int x509_get_sig_params(struct x509_certificate *cert);
0065 extern int x509_check_for_self_signed(struct x509_certificate *cert);