Skip to content

Commit 962a852

Browse files
author
carabasdaniel
authored
Merge pull request #370 from durist/main
(MODULES-11067) Fix keytool output parsing
2 parents 9b8471d + 9fb4972 commit 962a852

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/puppet/provider/java_ks/keytool.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,11 @@ def exists?
173173

174174
# Extracts the fingerprints of a given output
175175
def extract_fingerprint(output)
176-
output.scan(%r{Certificate fingerprints:\n\s+(?:MD5: .*\n\s+)?SHA1: (.*)}).flatten.join('/')
176+
fps = []
177+
output.scan(%r{^Certificate fingerprints:(.*?)Signature?}m).flatten.each do |certblock|
178+
fps.push(certblock.scan(%r{^\s+\S+:\s+(\S+)}m))
179+
end
180+
fps.flatten.sort.join('/')
177181
end
178182

179183
# Reading the fingerprint of the certificate on disk.

0 commit comments

Comments
 (0)