diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-03-28 13:00:59 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-03-28 13:00:59 +0000 |
commit | 6ea230526a69dcb83ff1879b6390227f1e56ff80 (patch) | |
tree | 7de09f859107e08c2303679a881db008bf15dd72 /lib/gnutls_pk.c | |
parent | e647ed6625004b61496572b416dfe8e64b946495 (diff) | |
download | gnutls-6ea230526a69dcb83ff1879b6390227f1e56ff80.tar.gz |
*** empty log message ***
Diffstat (limited to 'lib/gnutls_pk.c')
-rw-r--r-- | lib/gnutls_pk.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gnutls_pk.c b/lib/gnutls_pk.c index fdd08b64b0..c5bc2ffdd5 100644 --- a/lib/gnutls_pk.c +++ b/lib/gnutls_pk.c @@ -178,7 +178,13 @@ int _gnutls_pkcs1_rsa_decrypt(gnutls_sdatum * plaintext, return GNUTLS_E_MPI_SCAN_FAILED; } - ret = _gnutls_pk_decrypt(GCRY_PK_RSA, &res, c, params); + /* we can use btype to see if the private key is + * available. + */ + if (btype==2) + ret = _gnutls_pk_decrypt(GCRY_PK_RSA, &res, c, params); + else + ret = _gnutls_pk_encrypt(GCRY_PK_RSA, &res, c, params); _gnutls_mpi_release(&c); if (ret < 0) { |