diff options
author | Daiki Ueno <ueno@unixuser.org> | 2011-05-24 14:43:55 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@unixuser.org> | 2011-05-24 15:11:08 +0900 |
commit | c567ee930108c27ba03003da077c449bdce0e217 (patch) | |
tree | 3bcac4e568d89454323a8f5181b9bf07db7a8f92 /cipher/rsa.c | |
parent | 3b12b9152ac81b756c23a487ae7922fdb310e738 (diff) | |
download | libgcrypt-c567ee930108c27ba03003da077c449bdce0e217.tar.gz |
Cleanup pk_encoding_ctx code.
Pass around verify function to pk_module->verify as some encodings like PSS
need custom verification logic.
Diffstat (limited to 'cipher/rsa.c')
-rw-r--r-- | cipher/rsa.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cipher/rsa.c b/cipher/rsa.c index 1973280e..ccc9f964 100644 --- a/cipher/rsa.c +++ b/cipher/rsa.c @@ -1036,8 +1036,10 @@ rsa_verify (int algo, gcry_mpi_t hash, gcry_mpi_t *data, gcry_mpi_t *pkey, log_mpidump (" hash:", hash ); } #endif /*IS_DEVELOPMENT_VERSION*/ - /*rc = (*cmp)( opaquev, result );*/ - rc = mpi_cmp (result, hash) ? GPG_ERR_BAD_SIGNATURE : GPG_ERR_NO_ERROR; + if (cmp) + rc = (*cmp) (opaquev, result); + else + rc = mpi_cmp (result, hash) ? GPG_ERR_BAD_SIGNATURE : GPG_ERR_NO_ERROR; gcry_mpi_release (result); return rc; |