Merge pull request #16408 from nicolasnoble/fix-tsi-ssl-auth-context-reuse-string

Fixing the SSL_REUSE auth context string attribute.
pull/16457/head
Nicolas Noble 6 years ago committed by GitHub
commit 98fd5a73c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/core/tsi/ssl_transport_security.cc
  2. 6
      test/core/tsi/ssl_transport_security_test.cc

@ -1051,9 +1051,9 @@ static tsi_result ssl_handshaker_result_extract_peer(
}
const char* session_reused = SSL_session_reused(impl->ssl) ? "true" : "false";
result = tsi_construct_string_peer_property(
result = tsi_construct_string_peer_property_from_cstring(
TSI_SSL_SESSION_REUSED_PEER_PROPERTY, session_reused,
strlen(session_reused) + 1, &peer->properties[peer->property_count]);
&peer->properties[peer->property_count]);
if (result != TSI_OK) return result;
peer->property_count++;

@ -208,9 +208,11 @@ static void check_session_reusage(ssl_tsi_test_fixture* ssl_fixture,
tsi_peer_get_property_by_name(peer, TSI_SSL_SESSION_REUSED_PEER_PROPERTY);
GPR_ASSERT(session_reused != nullptr);
if (ssl_fixture->session_reused) {
GPR_ASSERT(strcmp(session_reused->value.data, "true") == 0);
GPR_ASSERT(strncmp(session_reused->value.data, "true",
session_reused->value.length) == 0);
} else {
GPR_ASSERT(strcmp(session_reused->value.data, "false") == 0);
GPR_ASSERT(strncmp(session_reused->value.data, "false",
session_reused->value.length) == 0);
}
}

Loading…
Cancel
Save