]> Cypherpunks repositories - gostls13.git/commit
crypto/x509/internal/macos: handle unexpected null returns
authorRoland Shoemaker <roland@golang.org>
Mon, 3 Oct 2022 16:19:32 +0000 (09:19 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 4 Oct 2022 16:03:32 +0000 (16:03 +0000)
commitfa463cc96d797c218be4e218723f83be47e814c8
treeb578f0a5636d321b7c351743ac5d3476c63f998c
parent6a9aaf1f0218d61aa44c3a0ae0bce03cbac93328
crypto/x509/internal/macos: handle unexpected null returns

SecCreatePolicySSL returns null when called from a binary that has a
strange path. This seems to be a weirdo macos bug, but we should be
properly handling those null returns anyway. Also add handling for
SecTrustGetCertificateAtIndex.

Fixes #54590

Change-Id: I251e74f3b0bf65890a80b094b3e88718e13fd3db
Reviewed-on: https://go-review.googlesource.com/c/go/+/438135
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
src/crypto/x509/internal/macos/security.go
src/crypto/x509/internal/macos/security.s
src/crypto/x509/root_darwin.go