Skip to content

Commit

Permalink
try to turn on secitem testing
Browse files Browse the repository at this point in the history
  • Loading branch information
sbSteveK committed Oct 17, 2024
1 parent f2fd4cd commit 9bde1ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
cmake_options:
- "-DAWS_USE_DISPATCH_QUEUE=ON"
- "-DAWS_USE_DISPATCH_QUEUE=OFF"
- "-DAWS_USE_DISPATCH_QUEUE=ON -DAWS_USE_SECITEM=ON"
- "-DAWS_USE_SECITEM=ON"
steps:
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
Expand All @@ -184,7 +184,7 @@ jobs:
runs-on: macos-14 # latest
strategy:
matrix:
eventloop: ["-DAWS_USE_DISPATCH_QUEUE=ON", "-DAWS_USE_DISPATCH_QUEUE=OFF"]
eventloop: ["-DAWS_USE_DISPATCH_QUEUE=ON", "-DAWS_USE_DISPATCH_QUEUE=OFF", "-DAWS_USE_SECITEM=ON"]
steps:
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
Expand Down
10 changes: 6 additions & 4 deletions source/darwin/nw_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ static int s_setup_socket_params(struct nw_socket *nw_socket, const struct aws_s
CFErrorRef error = NULL;
SecTrustRef trust_ref = sec_trust_copy_ref(trust);
OSStatus status;
bool verification_successful = false;

/* Use root ca if provided. */
if (transport_ctx->ca_cert != NULL) {
Expand Down Expand Up @@ -375,32 +376,33 @@ static int s_setup_socket_params(struct nw_socket *nw_socket, const struct aws_s
// Proceed based on the trust_result if necessary
if (trust_result == kSecTrustResultProceed ||
trust_result == kSecTrustResultUnspecified) {
complete(true);
verification_successful = true;
} else {
complete(false);
verification_successful = false;
}
} else {
AWS_LOGF_DEBUG(
AWS_LS_IO_TLS,
"id=%p: nw_socket SecTrustGetTrustResult failed with OSStatus: %d",
(void *)nw_socket,
(int)status);
complete(false);
verification_successful = false;
}
} else {
AWS_LOGF_DEBUG(
AWS_LS_IO_TLS,
"id=%p: nw_socket SecTrustEvaluateWithError failed with error code: %ld",
(void *)nw_socket,
(long)CFErrorGetCode(error));
complete(false);
verification_successful = false;
}

verification_done:
CFRelease(trust_ref);
if (error) {
CFRelease(error);
}
complete(verification_successful);
},
dispatch_loop->dispatch_queue);
},
Expand Down

0 comments on commit 9bde1ae

Please sign in to comment.