diff options
author | NIIBE Yutaka <[email protected]> | 2021-12-22 11:11:42 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2021-12-22 11:11:42 +0000 |
commit | d08072093928f187aa3dde579b9be5eb87710eeb (patch) | |
tree | 1e6fd60796e448af716408f92ee15bb1038c7bd4 /g10/pkglue.c | |
parent | experiment: Fix for signature R+S in OpenPGP R part. (diff) | |
download | gnupg-gniibe/v5/448.tar.gz gnupg-gniibe/v5/448.zip |
experiment: Handle S=0 in EdDSA by SOS("0").gniibe/v5/448
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'g10/pkglue.c')
-rw-r--r-- | g10/pkglue.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/g10/pkglue.c b/g10/pkglue.c index 019e5bac6..05bce14bf 100644 --- a/g10/pkglue.c +++ b/g10/pkglue.c @@ -319,15 +319,11 @@ pk_verify (pubkey_algo_t pkalgo, gcry_mpi_t hash, } } } - /* - * When data[1] is NULL or [0], parse the signature into R and S - * parts. - */ - else if (!s - || (gcry_mpi_get_flag (s, GCRYMPI_FLAG_OPAQUE) - && ((p = gcry_mpi_get_opaque (s, &nbits)) == NULL - || nbits == 0 - || ((nbits+7)/8 == 1 && p[0] == 0)))) + else if (gcry_mpi_get_flag (s, GCRYMPI_FLAG_OPAQUE) + && ((p = gcry_mpi_get_opaque (s, &nbits)) == NULL + || nbits == 0 + || ((nbits+7)/8 == 1 && p[0] == 0))) + /* When data[1] is MPI(0), parse the signature into R and S parts. */ openpgp_ecc_parse_signature (pkalgo, r, &r, &s); else rc = 0; |