Skip to content

Commit

Permalink
Add PKCS7-internal cipher BIO
Browse files Browse the repository at this point in the history
  • Loading branch information
WillChilds-Klein committed Sep 6, 2024
1 parent 16ca6e7 commit bd158f6
Show file tree
Hide file tree
Showing 4 changed files with 469 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ add_library(
pem/pem_xaux.c
pkcs7/pkcs7.c
pkcs7/pkcs7_asn1.c
pkcs7/pkcs7_internal_bio_cipher.c
pkcs7/pkcs7_x509.c
pkcs8/pkcs8.c
pkcs8/pkcs8_x509.c
Expand Down Expand Up @@ -817,6 +818,7 @@ if(BUILD_TESTING)
obj/obj_test.cc
ocsp/ocsp_test.cc
pem/pem_test.cc
pkcs7/pkcs7_internal_bio_test.cc
pkcs7/pkcs7_test.cc
pkcs8/pkcs8_test.cc
pkcs8/pkcs12_test.cc
Expand Down
9 changes: 9 additions & 0 deletions crypto/pkcs7/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,15 @@ int pkcs7_add_signed_data(CBB *out,
int (*signer_infos_cb)(CBB *out, const void *arg),
const void *arg);

// TODO [childw]
const BIO_METHOD *BIO_f_cipher(void);

#define BIO_get_cipher_ctx(bio, contents) \
BIO_ctrl(bio, BIO_C_GET_CIPHER_CTX, 0, (char *)(contents))

#define BIO_get_cipher_status(bio) \
BIO_ctrl(bio, BIO_C_GET_CIPHER_STATUS, 0, NULL)


#if defined(__cplusplus)
} // extern C
Expand Down
Loading

0 comments on commit bd158f6

Please sign in to comment.