summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-05-01 12:42:57 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-05-01 12:52:20 +0200
commit162a35176ecb5189177be5dfcba267924758ca53 (patch)
tree79296fdfffd685600d677b68fb04cbdb93561ec7
parent7265612d87f51c2f52a2e4cf5bdf14f31bd291a2 (diff)
downloadgnutls-162a35176ecb5189177be5dfcba267924758ca53.tar.gz
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 <nmav@redhat.com>
-rw-r--r--lib/errors.c6
-rw-r--r--lib/includes/gnutls/gnutls.h.in1
2 files changed, 7 insertions, 0 deletions
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