gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, master, updated. gnutls_2_9_10-307-g5b9c9b5


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_9_10-307-g5b9c9b5
Date: Sat, 17 Jul 2010 15:52:39 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=5b9c9b55e8947aebd607d072f620d84b3c98a19c

The branch, master has been updated
       via  5b9c9b55e8947aebd607d072f620d84b3c98a19c (commit)
      from  f4092ad7c129b801b7f61ec1e721c52076fd2661 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5b9c9b55e8947aebd607d072f620d84b3c98a19c
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sat Jul 17 17:51:52 2010 +0200

    Added blinding to RSA decryption AND signing. Will stay there until it is 
moved to nettle itself.

-----------------------------------------------------------------------

Summary of changes:
 lib/nettle/pk.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/lib/nettle/pk.c b/lib/nettle/pk.c
index 95cba4f..4681fca 100644
--- a/lib/nettle/pk.c
+++ b/lib/nettle/pk.c
@@ -275,7 +275,7 @@ _wrap_nettle_pk_sign(gnutls_pk_algorithm_t algo,
        }
        case GNUTLS_PK_RSA: {
                struct rsa_private_key priv;
-               bigint_t hash;
+               bigint_t hash, nc, ri;
                
                if (_gnutls_mpi_scan_nz(&hash, vdata->data, vdata->size) != 0) {
                        gnutls_assert();
@@ -285,12 +285,25 @@ _wrap_nettle_pk_sign(gnutls_pk_algorithm_t algo,
                rsa_private_key_init(&priv);
                _rsa_params_to_privkey(pk_params, &priv);
 
-               rsa_compute_root(&priv, TOMPZ(hash), TOMPZ(hash));
+               nc = rsa_blind(hash, pk_params->params[1]/*e*/,
+                       pk_params->params[0]/*m*/, &ri);
 
-               ret = _gnutls_mpi_dprint(hash, signature);
                _gnutls_mpi_release(&hash);
 
-               if (ret < 0) {
+               if (nc == NULL) {
+                       gnutls_assert();
+                       return GNUTLS_E_MEMORY_ERROR;
+               }
+
+               rsa_compute_root(&priv, TOMPZ(nc), TOMPZ(nc));
+
+               rsa_unblind(nc, ri, pk_params->params[0]/*m*/);
+
+               ret = _gnutls_mpi_dprint(nc, signature);
+               _gnutls_mpi_release(&nc);
+               _gnutls_mpi_release(&ri);
+
+               if (ret < 0) {
                        gnutls_assert();
                        goto cleanup;
                }


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]