From efadbf79e9c864578bfd1277d824e69b2989aac5 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Thu, 30 Mar 2006 07:22:01 +0000 Subject: - rewrote a lot of RSA stuff - done major work for ASN1/decoder - allow loading of ASN1 der encoded private keys, public keys and certificates - extracting public key from certificates - passing certificates from stroke to charon => basic authentication with RSA certificates works! --- Source/charon/sa/authenticator.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Source/charon/sa/authenticator.c') diff --git a/Source/charon/sa/authenticator.c b/Source/charon/sa/authenticator.c index 2ec1733e1..20667f736 100644 --- a/Source/charon/sa/authenticator.c +++ b/Source/charon/sa/authenticator.c @@ -205,6 +205,8 @@ static status_t verify_auth_data (private_authenticator_t *this, &preshared_secret); if (status != SUCCESS) { + this->logger->log(this->logger, ERROR|LEVEL1, "No shared secret found for %s", + other_id->get_string(other_id)); other_id->destroy(other_id); return status; } @@ -252,6 +254,8 @@ static status_t verify_auth_data (private_authenticator_t *this, &public_key); if (status != SUCCESS) { + this->logger->log(this->logger, ERROR|LEVEL1, "No RSA public key found for %s", + other_id->get_string(other_id)); other_id->destroy(other_id); return status; } @@ -307,11 +311,14 @@ static status_t compute_auth_data (private_authenticator_t *this, my_id, &preshared_secret); - my_id->destroy(my_id); if (status != SUCCESS) { + this->logger->log(this->logger, ERROR|LEVEL1, "No shared secret found for %s", + my_id->get_string(my_id)); + my_id->destroy(my_id); return status; } + my_id->destroy(my_id); auth_data = this->build_preshared_secret_signature(this, last_sent_packet, other_nonce, my_id_payload, initiator, preshared_secret); @@ -331,11 +338,14 @@ static status_t compute_auth_data (private_authenticator_t *this, chunk_t octets, auth_data; status = charon->credentials->get_rsa_private_key(charon->credentials, my_id, &private_key); - my_id->destroy(my_id); if (status != SUCCESS) { + this->logger->log(this->logger, ERROR|LEVEL1, "No RSA private key found for %s", + my_id->get_string(my_id)); + my_id->destroy(my_id); return status; } + my_id->destroy(my_id); octets = this->allocate_octets(this,last_sent_packet,other_nonce,my_id_payload,initiator); -- cgit v1.2.3