summaryrefslogtreecommitdiff
path: root/lib/gnutls_pk.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2002-03-28 13:00:59 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2002-03-28 13:00:59 +0000
commit6ea230526a69dcb83ff1879b6390227f1e56ff80 (patch)
tree7de09f859107e08c2303679a881db008bf15dd72 /lib/gnutls_pk.c
parente647ed6625004b61496572b416dfe8e64b946495 (diff)
downloadgnutls-6ea230526a69dcb83ff1879b6390227f1e56ff80.tar.gz
*** empty log message ***
Diffstat (limited to 'lib/gnutls_pk.c')
-rw-r--r--lib/gnutls_pk.c8
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) {