summaryrefslogtreecommitdiff
path: root/cipher/sha512.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2021-09-09 11:57:15 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2021-09-14 11:17:19 +0900
commitd04b1be9edacd7be6f03faba6f4d6c44c4247eb7 (patch)
tree2c2746ab349b283f0adbc05d2c3a7c48683c595d /cipher/sha512.c
parent422031a5943f2e698036e3c0df5955c585f22c16 (diff)
downloadlibgcrypt-d04b1be9edacd7be6f03faba6f4d6c44c4247eb7.tar.gz
cipher: Fix support of sha512-224 and sha512-256.
* cipher/pubkey-util.c (get_hash_algo): Add. * cipher/sha512.c (sha512_256_asn, sha512_224_asn): Fill correct values. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'cipher/sha512.c')
-rw-r--r--cipher/sha512.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/cipher/sha512.c b/cipher/sha512.c
index 6859cf52..45291567 100644
--- a/cipher/sha512.c
+++ b/cipher/sha512.c
@@ -1235,7 +1235,12 @@ gcry_md_spec_t _gcry_digest_spec_sha384 =
run_selftests
};
-static byte sha512_256_asn[] = { 0x30 };
+static byte sha512_256_asn[] =
+ {
+ 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86,
+ 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x06, 0x05,
+ 0x00, 0x04, 0x20
+ };
static gcry_md_oid_spec_t oid_spec_sha512_256[] =
{
@@ -1254,7 +1259,12 @@ gcry_md_spec_t _gcry_digest_spec_sha512_256 =
run_selftests
};
-static byte sha512_224_asn[] = { 0x30 };
+static byte sha512_224_asn[] =
+ {
+ 0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86,
+ 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x05, 0x05,
+ 0x00, 0x04, 0x1c
+ };
static gcry_md_oid_spec_t oid_spec_sha512_224[] =
{