mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-18 14:17:03 +01:00
dirmngr: Fix verification of ECDSA signed CRLs.
* dirmngr/crlcache.c (finish_sig_check): Use raw value for the data. -- This had the usual signed/unsigned problem. By using the modern form we enforce Libgcrypt internal parsing as unsigned integer.
This commit is contained in:
parent
80ccded042
commit
868dabb402
@ -1831,9 +1831,10 @@ finish_sig_check (ksba_crl_t crl, gcry_md_hd_t md, int algo,
|
|||||||
if (n > qbits/8)
|
if (n > qbits/8)
|
||||||
n = qbits/8;
|
n = qbits/8;
|
||||||
|
|
||||||
err = gcry_sexp_build (&s_hash, NULL, "%b",
|
err = gcry_sexp_build (&s_hash, NULL, "(data(flags raw)(value %b))",
|
||||||
(int)n,
|
(int)n,
|
||||||
gcry_md_read (md, algo));
|
gcry_md_read (md, algo));
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1852,7 +1853,7 @@ finish_sig_check (ksba_crl_t crl, gcry_md_hd_t md, int algo,
|
|||||||
/* Pass this on to the signature verification. */
|
/* Pass this on to the signature verification. */
|
||||||
err = gcry_pk_verify (s_sig, s_hash, s_pkey);
|
err = gcry_pk_verify (s_sig, s_hash, s_pkey);
|
||||||
if (DBG_X509)
|
if (DBG_X509)
|
||||||
log_debug ("gcry_pk_verify: %s\n", gpg_strerror (err));
|
log_debug ("%s: gcry_pk_verify: %s\n", __func__, gpg_strerror (err));
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
xfree (sigval);
|
xfree (sigval);
|
||||||
|
@ -1164,7 +1164,7 @@ check_cert_sig (ksba_cert_t issuer_cert, ksba_cert_t cert)
|
|||||||
if (!err)
|
if (!err)
|
||||||
err = gcry_pk_verify (s_sig, s_hash, s_pkey);
|
err = gcry_pk_verify (s_sig, s_hash, s_pkey);
|
||||||
if (DBG_X509)
|
if (DBG_X509)
|
||||||
log_debug ("gcry_pk_verify: %s\n", gpg_strerror (err));
|
log_debug ("%s: gcry_pk_verify: %s\n", __func__, gpg_strerror (err));
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
gcry_md_close (md);
|
gcry_md_close (md);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user