Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pkcs7 ctors #1710

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9d698c9
Add new function sigs + stubs
WillChilds-Klein Jun 11, 2024
5772cea
Add raw impls. from OSSL3 (except PKCS7_dup), no compile
WillChilds-Klein Jun 11, 2024
4251fee
/pkcs7_x509.c functions implemented, others not
WillChilds-Klein Jun 17, 2024
5531074
Impl PKCS7_new and PKCS7_dup
WillChilds-Klein Jun 17, 2024
23c5992
Implement PKCS7_content_new
WillChilds-Klein Jun 17, 2024
21e15ce
Implement PKCS7_set_type
WillChilds-Klein Jun 17, 2024
d07c012
Add remaining functions, need to impl. ASN1
WillChilds-Klein Jul 11, 2024
eb37923
Implement ASN1 functions
WillChilds-Klein Jul 11, 2024
8d40dd3
Fix PKCS7_add_signer
WillChilds-Klein Jul 11, 2024
b066c21
Fix PKCS7_new, consolidate some TODOs
WillChilds-Klein Jul 11, 2024
e113f27
Provisionally implement PKCS7_add_recipient_info and PKCS7_get_signer…
WillChilds-Klein Jul 11, 2024
5993a4b
Implement PKCS7_add_signer
WillChilds-Klein Jul 14, 2024
e9cc73f
Implement PKCS7_get_signed_attribute
WillChilds-Klein Jul 15, 2024
b537fb9
Implement PKCS7_SIGNER_INFO_set
WillChilds-Klein Jul 15, 2024
6912b72
Implement PKCS7_RECIP_INFO_set
WillChilds-Klein Jul 15, 2024
b6ea289
Make struct typedefs opaque
WillChilds-Klein Jul 15, 2024
13627f7
Revert opaqueness changes to preexisting structs for backwards compat
WillChilds-Klein Jul 15, 2024
6b80743
Implement PKCS7_set_content
WillChilds-Klein Jul 15, 2024
3471d04
Implement simple type functions
WillChilds-Klein Jul 15, 2024
2a5be1a
Remove unused ASN1 functions
WillChilds-Klein Jul 16, 2024
e6bd016
ASN1ify all the PKCS7 things, tests segfault
WillChilds-Klein Jul 16, 2024
c6a96c8
Reinstate BSSL i2d/d2i, add basic setter tests
WillChilds-Klein Jul 16, 2024
bd5025e
Fix struct typedefs
WillChilds-Klein Jul 17, 2024
c50d7e1
Remove custom i2d/d2i, now need to remove ber_bytes
WillChilds-Klein Jul 17, 2024
1a15179
Use d2i_PKCS7 instead of CBS, remove ber bytes from PKCS7
WillChilds-Klein Jul 17, 2024
4a80c89
temporarily skip test
WillChilds-Klein Jul 18, 2024
50713db
Replace BER-encoded test cert chain with recent DER
WillChilds-Klein Jul 18, 2024
358ca58
Add tests for PKCS7_type_is_* and use UniquePtr
WillChilds-Klein Jul 18, 2024
5034179
Add new test cert w/ SignerInfo, cover (almost) all getters
WillChilds-Klein Jul 18, 2024
826db91
More coverage, ECDSA branch of PKCS7_SIGNER_INFO_set not working
WillChilds-Klein Jul 24, 2024
74ce341
Use encrypted type DER
WillChilds-Klein Jul 24, 2024
d723b33
Scrap encrypted type and RECIP_INFO for now
WillChilds-Klein Jul 24, 2024
6691391
Fix EC key path for PKCS7_SIGNER_INFO_set
WillChilds-Klein Jul 24, 2024
d3b9f24
Fix memory leaks
WillChilds-Klein Jul 25, 2024
1f6492c
Cover PKCS7_RECIP_INFO funcs
WillChilds-Klein Jul 25, 2024
61b84d0
Fix last memory leak
WillChilds-Klein Jul 25, 2024
2fb25be
Cover {d2i,i2d}_PKCS7_bio
WillChilds-Klein Jul 25, 2024
62c835a
Consolidate PKCS7 objs
WillChilds-Klein Jul 25, 2024
bb5d3be
Hopefully wrap up coverage
WillChilds-Klein Jul 25, 2024
b0c5d29
More coverage, fix memory leak
WillChilds-Klein Jul 26, 2024
0de2e76
Add back recip info free callback
WillChilds-Klein Jul 26, 2024
a58b87d
Move asn1 defs to own file, move non-x509 stuff to pkcs7.c
WillChilds-Klein Jul 26, 2024
0ec2f92
Adjust cert/crl funcs to better match ossl
WillChilds-Klein Jul 26, 2024
9c31551
Add doc comments
WillChilds-Klein Jul 29, 2024
6016c77
Merge branch 'aws:main' into pkcs7-ctors
WillChilds-Klein Aug 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ add_library(
pem/pem_x509.c
pem/pem_xaux.c
pkcs7/pkcs7.c
pkcs7/pkcs7_asn1.c
pkcs7/pkcs7_x509.c
pkcs8/pkcs8.c
pkcs8/pkcs8_x509.c
Expand Down
49 changes: 49 additions & 0 deletions crypto/pkcs7/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,55 @@
extern "C" {
#endif

struct pkcs7_issuer_and_serial_st {
X509_NAME *issuer;
ASN1_INTEGER *serial;
};

struct pkcs7_signer_info_st {
ASN1_INTEGER *version;
PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
X509_ALGOR *digest_alg;
STACK_OF(X509_ATTRIBUTE) *auth_attr;
X509_ALGOR *digest_enc_alg;
ASN1_OCTET_STRING *enc_digest;
STACK_OF(X509_ATTRIBUTE) *unauth_attr;
EVP_PKEY *pkey;
};

struct pkcs7_recip_info_st {
ASN1_INTEGER *version;
PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
X509_ALGOR *key_enc_algor;
ASN1_OCTET_STRING *enc_key;
X509 *cert;
};

struct pkcs7_enc_content_st {
ASN1_OBJECT *content_type;
X509_ALGOR *algorithm;
ASN1_OCTET_STRING *enc_data;
const EVP_CIPHER *cipher;
};

struct pkcs7_envelope_st {
ASN1_INTEGER *version;
PKCS7_ENC_CONTENT *enc_data;
STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
};

struct pkcs7_digest_st {
ASN1_INTEGER *version;
X509_ALGOR *digest_alg;
PKCS7 *contents;
ASN1_OCTET_STRING *digest;
const EVP_MD *md;
};

struct pkcs7_encrypt_st {
ASN1_INTEGER *version;
PKCS7_ENC_CONTENT *enc_data;
};

// pkcs7_parse_header reads the non-certificate/non-CRL prefix of a PKCS#7
// SignedData blob from |cbs| and sets |*out| to point to the rest of the
Expand Down
Loading
Loading