Skip to content

Commit

Permalink
Add back BIO encrypt/decrypt, tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
WillChilds-Klein committed Nov 15, 2024
1 parent cb03225 commit bd4e275
Show file tree
Hide file tree
Showing 7 changed files with 557 additions and 21 deletions.
3 changes: 2 additions & 1 deletion crypto/asn1/tasn_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,8 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, const unsigned char **in,
cont = *in;
len = p - cont + plen;
p += plen;
} else if (cst) {
// TODO [childw] explain
// } else if (cst) {
// This parser historically supported BER constructed strings. We no
// longer do and will gradually tighten this parser into a DER
// parser. BER types should use |CBS_asn1_ber_to_der|.
Expand Down
3 changes: 0 additions & 3 deletions crypto/pkcs7/bio/bio_cipher_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
// NOTE: need to keep this in sync with sizeof(ctx->buf) cipher.c
#define ENC_BLOCK_SIZE 1024 * 4

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

struct CipherParams {
const char name[40];
const EVP_CIPHER *(*cipher)(void);
Expand Down
4 changes: 4 additions & 0 deletions crypto/pkcs7/bio/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,7 @@ const BIO_METHOD *BIO_f_cipher(void) { return &methods_enc; }
int BIO_get_cipher_ctx(BIO *b, EVP_CIPHER_CTX **ctx) {
return BIO_ctrl(b, BIO_C_GET_CIPHER_CTX, 0, ctx);
}

int BIO_get_cipher_status(BIO *b) {
return BIO_ctrl(b, BIO_C_GET_CIPHER_STATUS, 0, NULL);
}
Loading

0 comments on commit bd4e275

Please sign in to comment.