Skip to content

Commit

Permalink
add short-circuit
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Nov 4, 2024
1 parent f04e634 commit c318368
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,11 @@ func FIPSProvider() bool {
// Load the provider with and without the `fips=yes` query.
// If the providers are the same, then the default provider is FIPS-capable.
provFIPS := provFn(propFIPS)
if provFIPS == nil {
return false
}
provDefault := provFn(nil)
return provFIPS != nil && provFIPS == provDefault
return provFIPS == provDefault
}

// isProviderAvailable checks if the provider with the given name is available.
Expand Down

0 comments on commit c318368

Please sign in to comment.