Path: blob/master/crypto/asymmetric_keys/pkcs7_parser.h
26285 views
/* SPDX-License-Identifier: GPL-2.0-or-later */1/* PKCS#7 crypto data parser internal definitions2*3* Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.4* Written by David Howells ([email protected])5*/67#include <linux/oid_registry.h>8#include <crypto/pkcs7.h>9#include "x509_parser.h"1011#define kenter(FMT, ...) \12pr_devel("==> %s("FMT")\n", __func__, ##__VA_ARGS__)13#define kleave(FMT, ...) \14pr_devel("<== %s()"FMT"\n", __func__, ##__VA_ARGS__)1516struct pkcs7_signed_info {17struct pkcs7_signed_info *next;18struct x509_certificate *signer; /* Signing certificate (in msg->certs) */19unsigned index;20bool unsupported_crypto; /* T if not usable due to missing crypto */21bool blacklisted;2223/* Message digest - the digest of the Content Data (or NULL) */24const void *msgdigest;25unsigned msgdigest_len;2627/* Authenticated Attribute data (or NULL) */28unsigned authattrs_len;29const void *authattrs;30unsigned long aa_set;31#define sinfo_has_content_type 032#define sinfo_has_signing_time 133#define sinfo_has_message_digest 234#define sinfo_has_smime_caps 335#define sinfo_has_ms_opus_info 436#define sinfo_has_ms_statement_type 537time64_t signing_time;3839/* Message signature.40*41* This contains the generated digest of _either_ the Content Data or42* the Authenticated Attributes [RFC2315 9.3]. If the latter, one of43* the attributes contains the digest of the Content Data within it.44*45* This also contains the issuing cert serial number and issuer's name46* [PKCS#7 or CMS ver 1] or issuing cert's SKID [CMS ver 3].47*/48struct public_key_signature *sig;49};5051struct pkcs7_message {52struct x509_certificate *certs; /* Certificate list */53struct x509_certificate *crl; /* Revocation list */54struct pkcs7_signed_info *signed_infos;55u8 version; /* Version of cert (1 -> PKCS#7 or CMS; 3 -> CMS) */56bool have_authattrs; /* T if have authattrs */5758/* Content Data (or NULL) */59enum OID data_type; /* Type of Data */60size_t data_len; /* Length of Data */61size_t data_hdrlen; /* Length of Data ASN.1 header */62const void *data; /* Content Data (or 0) */63};646566