diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-12-28 15:17:50 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-12-28 15:17:50 +0000 |
commit | 291e102c0618d6c342e6d6abf4c4cc0be5d333f5 (patch) | |
tree | a6b20d1dc9fd0ae10daa36f9bf3ea552db6d8288 /lib/auth_cert.c | |
parent | ff4c7c67a36b23114cbb9175820826ee048f5edb (diff) | |
download | gnutls-291e102c0618d6c342e6d6abf4c4cc0be5d333f5.tar.gz |
updated the client retrieval certificate callback.
Diffstat (limited to 'lib/auth_cert.c')
-rw-r--r-- | lib/auth_cert.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/auth_cert.c b/lib/auth_cert.c index d069ac6685..de770cc358 100644 --- a/lib/auth_cert.c +++ b/lib/auth_cert.c @@ -110,10 +110,8 @@ int _gnutls_copy_certificate_auth_info(CERTIFICATE_AUTH_INFO info, * -1 otherwise. */ inline - static int _gnutls_check_pk_algo_in_list(gnutls_pk_algorithm * - pk_algos, int pk_algos_length, - gnutls_pk_algorithm - algo_to_check) +static int _gnutls_check_pk_algo_in_list(const gnutls_pk_algorithm *pk_algos, + int pk_algos_length, gnutls_pk_algorithm algo_to_check) { int i; for (i = 0; i < pk_algos_length; i++) { @@ -131,7 +129,7 @@ inline */ static int _find_x509_cert(const gnutls_certificate_credentials cred, opaque * _data, size_t _data_size, - gnutls_pk_algorithm * pk_algos, + const gnutls_pk_algorithm * pk_algos, int pk_algos_length, int *indx) { uint size; @@ -401,15 +399,17 @@ static int call_client_cert_callback(gnutls_session session, OPENPGP_KEY_DEINIT _E_gnutls_openpgp_key_deinit; OPENPGP_PRIVKEY_DEINIT _E_gnutls_openpgp_privkey_deinit; + /* Calls the client get callback. */ static int call_get_cert_callback( gnutls_session session, - gnutls_datum* issuers_dn, int issuers_dn_length) + gnutls_datum* issuers_dn, int issuers_dn_length, + gnutls_pk_algorithm* pk_algos, int pk_algos_length) { uint i; gnutls_cert *local_certs = NULL; gnutls_privkey *local_key = NULL; -retr_st st; +gnutls_retr_st st; int ret; gnutls_certificate_type type = gnutls_certificate_type_get(session); @@ -431,6 +431,7 @@ const gnutls_certificate_credentials cred; ret = cred->client_get_cert_callback(session, issuers_dn, issuers_dn_length, + pk_algos, pk_algos_length, &st); } @@ -547,7 +548,8 @@ static int _select_client_cert(gnutls_session session, } if (cred->client_get_cert_callback) { - result = call_get_cert_callback( session, issuers_dn, issuers_dn_length); + result = call_get_cert_callback( session, issuers_dn, issuers_dn_length, + pk_algos, pk_algos_length); goto cleanup; } @@ -1621,7 +1623,7 @@ int _gnutls_server_select_cert(gnutls_session session, */ if (cred->server_get_cert_callback != NULL) { - return call_get_cert_callback( session, NULL, 0); + return call_get_cert_callback( session, NULL, 0, NULL, 0); } else if (session->internals.server_cert_callback != NULL && cred->ncerts > 0) { |