diff options
Diffstat (limited to 'lib/sisu/v6/param.rb')
-rw-r--r-- | lib/sisu/v6/param.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/sisu/v6/param.rb b/lib/sisu/v6/param.rb index e3eaebae..9d310f7c 100644 --- a/lib/sisu/v6/param.rb +++ b/lib/sisu/v6/param.rb @@ -1281,14 +1281,23 @@ module SiSU_Param if @sys.openssl !=false \ and FileTest.file?(@env.source_file_with_path) @dgst=[] - if @env.digest.type =~/sha256/ + case @env.digest(@opt).type + when :sha512 + dgst=@sys.sha512(@env.source_file_with_path) + @dgst=dgst[1].length==128 ? dgst : nil + puts 'check document (sha512) digest' if not @dgst + when :sha256 dgst=@sys.sha256(@env.source_file_with_path) @dgst=dgst[1].length==64 ? dgst : nil puts 'check document (sha256) digest' if not @dgst - else + when :md5 dgst=@sys.md5(@env.source_file_with_path) @dgst=dgst[1].length==32 ? dgst : nil puts 'check document (md5) digest' if not @dgst + else + dgst=@sys.sha256(@env.source_file_with_path) + @dgst=dgst[1].length==64 ? dgst : nil + puts 'check document (sha256) digest' if not @dgst end elsif not FileTest.file?(@env.source_file_with_path) #puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) |