diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-08-07 18:01:45 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-08-07 18:01:45 +0000 |
commit | e9964513db0626bda7ade731b39c388514f653c2 (patch) | |
tree | 822bea73eff3248b3d0c14ca8f7a5c17ea60fb31 /lib/gnutls_pk.c | |
parent | 2df1162fa6b6df695d2bd5d50f481c18783538f6 (diff) | |
download | gnutls-e9964513db0626bda7ade731b39c388514f653c2.tar.gz |
Ported to the new libgcrypt (still unstable). Also added the RC2 cipher and improved the PKCS #12 stuff in order to support it.
Diffstat (limited to 'lib/gnutls_pk.c')
-rw-r--r-- | lib/gnutls_pk.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/gnutls_pk.c b/lib/gnutls_pk.c index 036f23964e..7f4fe1b652 100644 --- a/lib/gnutls_pk.c +++ b/lib/gnutls_pk.c @@ -519,7 +519,7 @@ int _gnutls_dsa_verify( const gnutls_datum* vdata, const gnutls_datum *sig_value */ static int _gnutls_pk_encrypt(int algo, GNUTLS_MPI * resarr, GNUTLS_MPI data, GNUTLS_MPI * pkey, int pkey_len) { - GCRY_SEXP s_ciph, s_data, s_pkey; + gcry_sexp_t s_ciph, s_data, s_pkey; int rc=-1; /* make a sexp from pkey */ @@ -558,7 +558,7 @@ static int _gnutls_pk_encrypt(int algo, GNUTLS_MPI * resarr, GNUTLS_MPI data, GN return GNUTLS_E_PK_ENCRYPTION_FAILED; } else { /* add better error handling or make gnupg use S-Exp directly */ - GCRY_SEXP list = gcry_sexp_find_token(s_ciph, "a", 0); + gcry_sexp_t list = gcry_sexp_find_token(s_ciph, "a", 0); if (list == NULL) { gnutls_assert(); gcry_sexp_release(s_ciph); @@ -579,9 +579,10 @@ static int _gnutls_pk_encrypt(int algo, GNUTLS_MPI * resarr, GNUTLS_MPI data, GN return rc; } -static int _gnutls_pk_decrypt(int algo, GNUTLS_MPI * resarr, GNUTLS_MPI data, GNUTLS_MPI * pkey, int pkey_len) +static +int _gnutls_pk_decrypt(int algo, GNUTLS_MPI * resarr, GNUTLS_MPI data, GNUTLS_MPI * pkey, int pkey_len) { - GCRY_SEXP s_plain, s_data, s_pkey; + gcry_sexp_t s_plain, s_data, s_pkey; int rc=-1; /* make a sexp from pkey */ @@ -620,7 +621,7 @@ static int _gnutls_pk_decrypt(int algo, GNUTLS_MPI * resarr, GNUTLS_MPI data, GN gnutls_assert(); return GNUTLS_E_PK_ENCRYPTION_FAILED; - } else { /* add better error handling or make gnupg use S-Exp directly */ + } else { /* add better error handling or make gnupg use S-Exp directly */ resarr[0] = gcry_sexp_nth_mpi(s_plain, 0, 0); if (resarr[0] == NULL) { @@ -640,7 +641,7 @@ static int _gnutls_pk_decrypt(int algo, GNUTLS_MPI * resarr, GNUTLS_MPI data, GN static int _gnutls_pk_sign(int algo, GNUTLS_MPI* data, GNUTLS_MPI hash, GNUTLS_MPI * pkey, int pkey_len) { - GCRY_SEXP s_hash, s_key, s_sig; + gcry_sexp_t s_hash, s_key, s_sig; int rc=-1; /* make a sexp from pkey */ @@ -692,7 +693,7 @@ int _gnutls_pk_sign(int algo, GNUTLS_MPI* data, GNUTLS_MPI hash, GNUTLS_MPI * pk return GNUTLS_E_PK_SIGN_FAILED; } else { - GCRY_SEXP list; + gcry_sexp_t list; if (algo==GCRY_PK_DSA) { list = gcry_sexp_find_token( s_sig, "r" , 0); @@ -734,7 +735,7 @@ int _gnutls_pk_sign(int algo, GNUTLS_MPI* data, GNUTLS_MPI hash, GNUTLS_MPI * pk static int _gnutls_pk_verify(int algo, GNUTLS_MPI hash, GNUTLS_MPI* data, GNUTLS_MPI *pkey, int pkey_len) { - GCRY_SEXP s_sig, s_hash, s_pkey; + gcry_sexp_t s_sig, s_hash, s_pkey; int rc=-1; /* make a sexp from pkey */ |