mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
Replace a call to BUG by an error return.
This commit is contained in:
parent
310f45b618
commit
16e76f3a69
@ -1,3 +1,8 @@
|
||||
2009-02-24 Werner Koch <wk@g10code.com>
|
||||
|
||||
* pkglue.c (pk_verify): Return an error for improper DATA instead
|
||||
of calling BUG().
|
||||
|
||||
2009-02-09 Werner Koch <wk@g10code.com>
|
||||
|
||||
* keylist.c (print_capabilities): Take care of cert-only keys.
|
||||
|
13
g10/pkglue.c
13
g10/pkglue.c
@ -134,13 +134,14 @@ pk_verify (int algo, gcry_mpi_t hash, gcry_mpi_t * data, gcry_mpi_t * pkey)
|
||||
return GPG_ERR_PUBKEY_ALGO;
|
||||
|
||||
if (rc)
|
||||
BUG ();
|
||||
BUG (); /* gcry_sexp_build should never fail. */
|
||||
|
||||
/* put hash into a S-Exp s_hash */
|
||||
if (gcry_sexp_build (&s_hash, NULL, "%m", hash))
|
||||
BUG ();
|
||||
BUG (); /* gcry_sexp_build should never fail. */
|
||||
|
||||
/* put data into a S-Exp s_sig */
|
||||
/* Put data into a S-Exp s_sig. */
|
||||
s_sig = NULL;
|
||||
if (algo == GCRY_PK_DSA)
|
||||
{
|
||||
if (!data[0] || !data[1])
|
||||
@ -167,11 +168,9 @@ pk_verify (int algo, gcry_mpi_t hash, gcry_mpi_t * data, gcry_mpi_t * pkey)
|
||||
else
|
||||
BUG ();
|
||||
|
||||
if (rc)
|
||||
BUG ();
|
||||
if (!rc)
|
||||
rc = gcry_pk_verify (s_sig, s_hash, s_pkey);
|
||||
|
||||
|
||||
rc = gcry_pk_verify (s_sig, s_hash, s_pkey);
|
||||
gcry_sexp_release (s_sig);
|
||||
gcry_sexp_release (s_hash);
|
||||
gcry_sexp_release (s_pkey);
|
||||
|
Loading…
x
Reference in New Issue
Block a user