Add some more accessors to SSL_SESSION.
Hopefully this is the last of it before we can hide the struct. We're
missing peer_sha256 accessors, and some test wants to mutate the ticket
in a test client.
Change-Id: I1a30fcc0a1e866d42acbc07a776014c9257f7c86
Reviewed-on: https://boringssl-review.googlesource.com/28268
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/ssl_test.cc b/ssl/ssl_test.cc
index 4a1497c..347f9da 100644
--- a/ssl/ssl_test.cc
+++ b/ssl/ssl_test.cc
@@ -1949,9 +1949,12 @@
EXPECT_FALSE(peer);
SSL_SESSION *session = SSL_get_session(server_.get());
- EXPECT_TRUE(session->peer_sha256_valid);
+ EXPECT_TRUE(SSL_SESSION_has_peer_sha256(session));
- EXPECT_EQ(Bytes(cert_sha256), Bytes(session->peer_sha256));
+ const uint8_t *peer_sha256;
+ size_t peer_sha256_len;
+ SSL_SESSION_get0_peer_sha256(session, &peer_sha256, &peer_sha256_len);
+ EXPECT_EQ(Bytes(cert_sha256), Bytes(peer_sha256, peer_sha256_len));
}
// Tests that our ClientHellos do not change unexpectedly. These are purely