Skip to content

Commit

Permalink
Added options for additional hashing algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
efrohnhoefer authored and gotthardp committed Oct 25, 2020
1 parent 2edae5e commit 23e306f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mkrequest
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,14 @@ subjectAltName=critical,DNS:$PARAMETER
subjectAltName=critical,email:$PARAMETER
_EOF_

if [ "$4" ]; then
DIGEST=-$4
else
DIGEST=""
fi

# Make request
openssl req -new -key $PREFIX.key -out $PREFIX.csr -config $CONFIG \
openssl req -new -key $PREFIX.key $DIGEST -out $PREFIX.csr -config $CONFIG \
-reqexts $EXT

# Make a self-signed certificate from request subject
Expand Down
8 changes: 8 additions & 0 deletions sscep.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ main(int argc, char **argv) {
sig_alg = (EVP_MD *)EVP_md5();
} else if (!strncmp(S_char, "sha1", 4)) {
sig_alg = (EVP_MD *)EVP_sha1();
} else if (!strncmp(S_char, "sha256", 6)) {
sig_alg = (EVP_MD *)EVP_sha256();
} else if (!strncmp(S_char, "sha512", 6)) {
sig_alg = (EVP_MD *)EVP_sha512();
} else {
fprintf(stderr, "%s: unsupported algorithm: %s\n",
pname, S_char);
Expand All @@ -512,6 +516,10 @@ main(int argc, char **argv) {
fp_alg = (EVP_MD *)EVP_md5();
} else if (!strncmp(F_char, "sha1", 4)) {
fp_alg = (EVP_MD *)EVP_sha1();
} else if (!strncmp(F_char, "sha256", 6)) {
fp_alg = (EVP_MD *)EVP_sha256();
} else if (!strncmp(F_char, "sha512", 6)) {
fp_alg = (EVP_MD *)EVP_sha512();
} else {
fprintf(stderr, "%s: unsupported algorithm: %s\n",
pname, F_char);
Expand Down

0 comments on commit 23e306f

Please sign in to comment.