add SHA512 for signing

This commit is contained in:
Klas Lindfors
2014-09-29 14:03:57 +02:00
parent ffbf0f2607
commit 5346cf4652
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ text "
9d is for Key Management 9d is for Key Management
9e is for Card Authentication (PIN never checked)\n" 9e is for Card Authentication (PIN never checked)\n"
option "algorithm" A "What algorithm to use" values="RSA1024","RSA2048","ECCP256" enum optional default="RSA2048" option "algorithm" A "What algorithm to use" values="RSA1024","RSA2048","ECCP256" enum optional default="RSA2048"
option "hash" H "Hash to use for the signature" values="SHA1","SHA256" enum optional default="SHA1" option "hash" H "Hash to use for the signature" values="SHA1","SHA256","SHA512" enum optional default="SHA1"
option "input" i "Filename to use as input, - for stdin" string optional default="-" option "input" i "Filename to use as input, - for stdin" string optional default="-"
option "output" o "Filename to use as output, - for stdout" string optional default="-" option "output" o "Filename to use as output, - for stdout" string optional default="-"
option "pin" P "Pin code for verification" string option "pin" P "Pin code for verification" string
+4
View File
@@ -117,6 +117,10 @@ static bool sign_file(ykpiv_state *state, const char *input, const char *output,
md = EVP_sha256(); md = EVP_sha256();
nid = NID_sha256; nid = NID_sha256;
break; break;
case hash_arg_SHA512:
md = EVP_sha512();
nid = NID_sha512;
break;
case hash__NULL: case hash__NULL:
default: default:
goto out; goto out;