Merge pull request #1 from frodegill/digest_sha256

Added support for digest algorithm SHA256
This commit is contained in:
Frode Roxrud Gill 2022-03-13 11:54:16 +01:00 committed by GitHub
commit 46c09fa8a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View File

@ -61,8 +61,9 @@ public:
/** Supported digest algorithms (used for fingerprint). */
enum DigestAlgorithm {
DIGEST_MD5, /**< MD5 digest */
DIGEST_SHA1 /**< SHA1 digest */
DIGEST_MD5,
DIGEST_SHA1,
DIGEST_SHA256
};

View File

@ -311,10 +311,15 @@ const byteArray X509Certificate_GnuTLS::getFingerprint(const DigestAlgorithm alg
galgo = GNUTLS_DIG_MD5;
break;
case DIGEST_SHA256:
galgo = GNUTLS_DIG_SHA256;
break;
default:
case DIGEST_SHA1:
galgo = GNUTLS_DIG_SHA;
galgo = GNUTLS_DIG_SHA1;
break;
}

View File

@ -556,6 +556,11 @@ const byteArray X509Certificate_OpenSSL::getFingerprint(const DigestAlgorithm al
digest = EVP_md5();
break;
case DIGEST_SHA256:
digest = EVP_sha256();
break;
default:
case DIGEST_SHA1: