commit - 06f6b49b29480f8a3027791df2dcc85f1c871e6b
commit + b5d59aa6f5d4946adc16397ae3166d2ab3bfcccf
blob - 6f8831125f075cd3ee773d55426af3321e62bded
blob + 4d56beb1aa39c28bb2cc0143439f50206c940b3c
--- main.c
+++ main.c
case 'a':
if (strncmp(optarg, "rsa-", 4))
err(1, "invalid algorithm");
- if (strcmp(optarg + 4, "sha256") == 0) {
+ if (strcmp(optarg + 4, "sha256") == 0)
hashalg = HASH_SHA256;
- hash_md = EVP_sha256();
- } else if (strcmp(optarg + 4, "sha1") == 0) {
+ else if (strcmp(optarg + 4, "sha1") == 0)
hashalg = HASH_SHA1;
- hash_md = EVP_sha1();
- } else
+ else
err(1, "invalid algorithm");
break;
case 'c':
usage();
}
}
+ if (hashalg == HASH_SHA1)
+ hash_md = EVP_sha1();
+ else
+ hash_md = EVP_sha256();
log_init(debug, LOG_MAIL);
if (pledge("tmppath stdio", NULL) == -1)