summaryrefslogtreecommitdiff
path: root/lib/errors.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2016-09-17 11:31:29 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2016-09-17 11:43:39 +0200
commit2a98a39d7d986f740f21fa14e54cd4d1a5d6dca4 (patch)
treea7eec2639cd811aece45b30b7227d4b05e6b1163 /lib/errors.c
parentb96164f0cfcacfd5e89440f09fd844eb1e1827bc (diff)
downloadgnutls-2a98a39d7d986f740f21fa14e54cd4d1a5d6dca4.tar.gz
Introduced separate error codes for invalid private and public keys
This allows functions like decryption and verification to report the specific issue they encountered on public key error. The new codes are GNUTLS_E_PK_INVALID_PUBKEY and GNUTLS_E_PK_INVALID_PRIVKEY
Diffstat (limited to 'lib/errors.c')
-rw-r--r--lib/errors.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/errors.c b/lib/errors.c
index 05ef2e3171..5e4610bf8f 100644
--- a/lib/errors.c
+++ b/lib/errors.c
@@ -391,6 +391,10 @@ static const gnutls_error_entry error_entries[] = {
GNUTLS_E_IDNA_ERROR),
ERROR_ENTRY(N_("Cannot obtain resumption parameters while handshake is incomplete."),
GNUTLS_E_UNAVAILABLE_DURING_HANDSHAKE),
+ ERROR_ENTRY(N_("The obtained public key is invalid."),
+ GNUTLS_E_PK_INVALID_PUBKEY),
+ ERROR_ENTRY(N_("The private key is invalid."),
+ GNUTLS_E_PK_INVALID_PRIVKEY),
{NULL, NULL, 0}
};