summaryrefslogtreecommitdiff
path: root/cipher/rsa.c
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@unixuser.org>2011-05-24 14:43:55 +0900
committerDaiki Ueno <ueno@unixuser.org>2011-05-24 15:11:08 +0900
commitc567ee930108c27ba03003da077c449bdce0e217 (patch)
tree3bcac4e568d89454323a8f5181b9bf07db7a8f92 /cipher/rsa.c
parent3b12b9152ac81b756c23a487ae7922fdb310e738 (diff)
downloadlibgcrypt-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.c6
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;