Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions crypto/bio/bio_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1275,3 +1275,20 @@ TEST(BIOTest, TestCtrlCallback) {
bio_callback_cleanup();
ASSERT_EQ(BIO_free(bio), 1);
}

TEST(BIOTest, GetMemDataBackwardsCompat) {
bssl::UniquePtr<BIO> bio(BIO_new(BIO_s_mem()));
ASSERT_TRUE(bio);

const uint8_t contents[] = {0x72, 0x61, 0x63, 0x63, 0x6f, 0x6f, 0x6e};

// Write some test data
int write_len = BIO_write(bio.get(), contents, sizeof(contents));
ASSERT_EQ(sizeof(contents), (size_t)write_len);

// Yes, this is something gRPC does
const uint8_t *ptr = NULL;
long data_len = BIO_get_mem_data(bio.get(), &ptr);
ASSERT_EQ((size_t)data_len, sizeof(contents));
EXPECT_EQ(Bytes(contents, sizeof(contents)), Bytes(ptr, data_len));
}
1 change: 0 additions & 1 deletion crypto/ocsp/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ struct ocsp_basic_response_st {
STACK_OF(X509) *certs;
};

DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)
DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA)
DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)
DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE)
Expand Down
1 change: 1 addition & 0 deletions include/openssl/ocsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE)
DECLARE_ASN1_FUNCTIONS(OCSP_CERTID)
DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST)
DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)

// d2i_OCSP_REQUEST_bio parses a DER-encoded OCSP request from |bp|, converts it
// into an |OCSP_REQUEST|, and writes the result in |preq|.
Expand Down
Loading