summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-02-11 17:35:12 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-02-11 17:35:15 +0100
commit5aca686995c23a75c29613fc5abf803279969a1f (patch)
tree69ef2ef5ccbd2ea56ee1c6ae1b0b59234313dcde
parent1c5e9ed19b4fd035994739e83336f9bb483e9e22 (diff)
downloadgnutls-new-code-null.tar.gz
Introduced GNUTLS_E_ASN1_EMBEDDED_NULL_IN_STRINGnew-code-null
This error code is returned when an embedded NULL is detected in a string.
-rw-r--r--NEWS1
-rw-r--r--lib/errors.c2
-rw-r--r--lib/includes/gnutls/gnutls.h.in1
-rw-r--r--lib/x509/common.c2
4 files changed, 5 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index df2bdb9fb4..0f51a363b9 100644
--- a/NEWS
+++ b/NEWS
@@ -40,6 +40,7 @@ See the end for copying conditions.
** API and ABI modifications:
GNUTLS_INDEFINITE_TIMEOUT: Added
GNUTLS_ALPN_SERVER_PRECEDENCE: Added
+GNUTLS_E_ASN1_EMBEDDED_NULL_IN_STRING: Added
gnutls_check_version_numeric: Added
gnutls_x509_crq_set_subject_alt_othername: Added
gnutls_x509_crt_set_subject_alt_othername: Added
diff --git a/lib/errors.c b/lib/errors.c
index f25569bc36..9dc4d658a1 100644
--- a/lib/errors.c
+++ b/lib/errors.c
@@ -378,6 +378,8 @@ static const gnutls_error_entry error_entries[] = {
GNUTLS_E_UNEXPECTED_EXTENSIONS_LENGTH),
ERROR_ENTRY(N_("Peer's certificate has changed during a rehandshake."),
GNUTLS_E_SESSION_CERTIFICATE_CHANGED),
+ ERROR_ENTRY(N_("The provided string has an embedded null."),
+ GNUTLS_E_ASN1_EMBEDDED_NULL_IN_STRING),
{NULL, NULL, 0}
};
diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in
index 395f7a4515..68b95b914e 100644
--- a/lib/includes/gnutls/gnutls.h.in
+++ b/lib/includes/gnutls/gnutls.h.in
@@ -2662,6 +2662,7 @@ int gnutls_fips140_mode_enabled(void);
#define GNUTLS_E_CERTIFICATE_VERIFICATION_ERROR -348
#define GNUTLS_E_PRIVKEY_VERIFICATION_ERROR -349
#define GNUTLS_E_UNEXPECTED_EXTENSIONS_LENGTH -350 /*GNUTLS_A_DECODE_ERROR*/
+#define GNUTLS_E_ASN1_EMBEDDED_NULL_IN_STRING -351
#define GNUTLS_E_SELF_TEST_ERROR -400
#define GNUTLS_E_NO_SELF_TEST -401
diff --git a/lib/x509/common.c b/lib/x509/common.c
index c6ef979d4a..cbee0d30f8 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -1067,7 +1067,7 @@ _gnutls_x509_decode_string(unsigned int etype,
if (len != (size_t) output->size) {
_gnutls_free_datum(output);
- ret = gnutls_assert_val(GNUTLS_E_ASN1_DER_ERROR);
+ ret = gnutls_assert_val(GNUTLS_E_ASN1_EMBEDDED_NULL_IN_STRING);
}
}