From 162a35176ecb5189177be5dfcba267924758ca53 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 1 May 2017 12:42:57 +0200 Subject: gnutls.h: introduced GNUTLS_E_ASN1_TIME_ERROR This corresponds to libtasn1 ASN1_TIME_ENCODING_ERROR and indicates an error in the DER or BER encoding of time field. Signed-off-by: Nikos Mavrogiannopoulos --- lib/errors.c | 6 ++++++ lib/includes/gnutls/gnutls.h.in | 1 + 2 files changed, 7 insertions(+) diff --git a/lib/errors.c b/lib/errors.c index 7d50783950..b77ba48b1d 100644 --- a/lib/errors.c +++ b/lib/errors.c @@ -410,6 +410,8 @@ static const gnutls_error_entry error_entries[] = { GNUTLS_E_PK_INVALID_PUBKEY), ERROR_ENTRY(N_("The private key is invalid."), GNUTLS_E_PK_INVALID_PRIVKEY), + ERROR_ENTRY(N_("The DER time encoding is invalid."), + GNUTLS_E_ASN1_TIME_ERROR), {NULL, NULL, 0} }; @@ -564,6 +566,10 @@ const char *gnutls_strerror_name(int error) int _gnutls_asn2err(int asn_err) { switch (asn_err) { +#ifdef ASN1_TIME_ENCODING_ERROR + case ASN1_TIME_ENCODING_ERROR: + return GNUTLS_E_ASN1_TIME_ERROR; +#endif case ASN1_FILE_NOT_FOUND: return GNUTLS_E_FILE_ERROR; case ASN1_ELEMENT_NOT_FOUND: diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in index d7eec43d31..580cf9f00c 100644 --- a/lib/includes/gnutls/gnutls.h.in +++ b/lib/includes/gnutls/gnutls.h.in @@ -2866,6 +2866,7 @@ unsigned gnutls_fips140_mode_enabled(void); #define GNUTLS_E_INVALID_PASSWORD_STRING -415 #define GNUTLS_E_CERTIFICATE_TIME_ERROR -416 #define GNUTLS_E_RECORD_OVERFLOW -417 /* GNUTLS_A_RECORD_OVERFLOW */ +#define GNUTLS_E_ASN1_TIME_ERROR -418 #define GNUTLS_E_UNIMPLEMENTED_FEATURE -1250 -- cgit v1.2.1