Skip to content

Commit

Permalink
Use separate status var for alpn
Browse files Browse the repository at this point in the history
  • Loading branch information
sfodagain committed Dec 17, 2024
1 parent 6ace418 commit 695d70c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/windows/secure_channel_tls_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,9 +1087,10 @@ static int s_do_client_side_negotiation_step_2(struct aws_channel_handler *handl
if (sc_handler->alpn_list && aws_tls_is_alpn_available()) {
AWS_LOGF_TRACE(AWS_LS_IO_TLS, "id=%p: Retrieving negotiated protocol.", handler);
SecPkgContext_ApplicationProtocol alpn_result;
status = QueryContextAttributes(&sc_handler->sec_handle, SECPKG_ATTR_APPLICATION_PROTOCOL, &alpn_result);
SECURITY_STATUS alpn_status =
QueryContextAttributes(&sc_handler->sec_handle, SECPKG_ATTR_APPLICATION_PROTOCOL, &alpn_result);

if (status == SEC_E_OK) {
if (alpn_status == SEC_E_OK) {
if (alpn_result.ProtoNegoStatus == SecApplicationProtocolNegotiationStatus_Success) {
aws_byte_buf_init(&sc_handler->protocol, handler->alloc, alpn_result.ProtocolIdSize + 1);
memset(sc_handler->protocol.buffer, 0, alpn_result.ProtocolIdSize + 1);
Expand All @@ -1107,8 +1108,8 @@ static int s_do_client_side_negotiation_step_2(struct aws_channel_handler *handl
AWS_LS_IO_TLS,
"id=%p: Error retrieving negotiated protocol. SECURITY_STATUS is %d",
handler,
(int)status);
aws_error = s_determine_sspi_error(status);
(int)alpn_status);
aws_error = s_determine_sspi_error(alpn_status);
goto cleanup;
}
}
Expand Down

0 comments on commit 695d70c

Please sign in to comment.