Skip to content

Conversation

@csstaub
Copy link
Member

@csstaub csstaub commented Apr 23, 2024

Fix nil ptr deref on Windows/Linux when keychain flags are used.

The panic comes from line 67 in tls.go:

	if hasKeychainIdentity() {
		logger.Printf("using operating system keychain as certificate source")
		return certloader.CertificateFromKeychainIdentity(*keychainIdentity, *keychainIssuer, caBundlePath, *keychainRequireToken)
	}

Flag keychainRequireToken can't be nil, even if it's not supported on Windows/Linux.

@codecov
Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 81.23%. Comparing base (04b717c) to head (e11ae8a).
Report is 64 commits behind head on master.

Files Patch % Lines
main.go 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #448      +/-   ##
==========================================
+ Coverage   78.48%   81.23%   +2.75%     
==========================================
  Files          30       35       +5     
  Lines        2133     1828     -305     
==========================================
- Hits         1674     1485     -189     
+ Misses        379      255     -124     
- Partials       80       88       +8     
Flag Coverage Δ
darwin 79.26% <75.00%> (+1.81%) ⬆️
linux 85.52% <0.00%> (+1.83%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@csstaub csstaub merged commit f38441a into master Apr 29, 2024
@csstaub csstaub deleted the cs/keychain-windows-fix branch April 29, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants