Skip to content

Commit 85e2163

Browse files
fergmastaflexkares
authored andcommitted
Moves break inside store.is_key_entry logic
This PR was in response to an issue we were running into when converting Apple .p12 files into .pem using `OpenSSL::PKCS12`. When creating a new instance with an Apple .p12 file, the initializer was only checking the first alias in the `store` because of a break in the .each loop. If there is more than one alias, only the first is being checked. In the case of the our .p12 file, the SECOND alias passes `store.is_key_store`, but was being skipped because of the break. This moves the break inside the `store.is_key_entry` logic statement, which means each alias will be iterated through until either a match is found or there are no other aliases.
1 parent 6984ce2 commit 85e2163

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/openssl/pkcs12.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def initialize(str = nil, password = '')
7272
end
7373
end
7474
end
75+
break
7576
end
76-
break
7777
end
7878
rescue java.lang.Exception => e
7979
raise PKCS12Error, e.inspect

0 commit comments

Comments
 (0)