diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-07-31 09:22:51 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-08-04 16:53:54 +0200 |
commit | 40682c7349579a347c5fcadc9428c03039e3d3ee (patch) | |
tree | 2bf8c50afa3fb10b62b14bfc31922d886282d739 | |
parent | aa2b5b2a6ef721d50c470e6351cf9d782b8efa91 (diff) | |
download | gnutls-40682c7349579a347c5fcadc9428c03039e3d3ee.tar.gz |
removed references for "new" semantics of PEM base64 encode and decode
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | tests/base64-raw.c | 56 |
2 files changed, 2 insertions, 59 deletions
@@ -72,9 +72,6 @@ See the end for copying conditions. priority string options. These allows enabling all broken and SHA1-based signature algorithms in certificate verification, respectively. -** libgnutls: gnutls_pem_base64_encode/2() and gnutls_pem_base64_decode/2() can - be used to decode arbitrary base64 data if the header parameter is set to NULL. - ** libgnutls: Removed support for libidn; gnutls can now be compiled only with libidn2. @@ -89,6 +86,8 @@ See the end for copying conditions. ** psktool: Generate 256-bit keys by default. ** API and ABI modifications: +gnutls_base64_encode2: Added +gnutls_base64_decode2: Added gnutls_x509_crt_set_flags: Added gnutls_x509_crt_check_ip: Added gnutls_x509_ext_import_inhibit_anypolicy: Added diff --git a/tests/base64-raw.c b/tests/base64-raw.c index 7ad8bf65f3..83d363ee0f 100644 --- a/tests/base64-raw.c +++ b/tests/base64-raw.c @@ -77,26 +77,6 @@ static void encode(const char *test_name, const gnutls_datum_t *raw, const char gnutls_free(out.data); - in.data = (void*)expected; - in.size = strlen(expected); - ret = gnutls_pem_base64_decode2("", &in, &out); - if (ret < 0) { - fail("%s: gnutls_pem_base64_decode2: %s\n", test_name, gnutls_strerror(ret)); - exit(1); - } - - if (raw->size!=out.size) { - fail("%s: gnutls_pem_base64_decode2: output has incorrect size (%d, expected %d)\n", test_name, out.size, raw->size); - exit(1); - } - - if (memcmp(raw->data, out.data, out.size) != 0) { - fail("%s: gnutls_pem_base64_decode2: output does not match the expected\n", test_name); - exit(1); - } - - gnutls_free(out.data); - return; } @@ -164,41 +144,6 @@ static void encode_new(const char *test_name, const gnutls_datum_t *raw, const c return; } -static void decode(const char *test_name, const gnutls_datum_t *raw, const char *hex, int res) -{ - int ret; - gnutls_datum_t out, in; - - in.data = (void*)hex; - in.size = strlen(hex); - ret = gnutls_pem_base64_decode2("", &in, &out); - if (ret < 0) { - if (res == ret) /* expected */ - return; - fail("%s: gnutls_pem_base64_decode2: %d/%s\n", test_name, ret, gnutls_strerror(ret)); - exit(1); - } - - if (res != 0) { - fail("%s: gnutls_pem_base64_decode2: expected failure, but succeeded!\n", test_name); - exit(1); - } - - if (raw->size!=out.size) { - fail("%s: gnutls_pem_base64_decode2: output has incorrect size (%d, expected %d)\n", test_name, out.size, raw->size); - exit(1); - } - - if (memcmp(raw->data, out.data, out.size) != 0) { - fail("%s: gnutls_pem_base64_decode2: output does not match the expected\n", test_name); - exit(1); - } - - gnutls_free(out.data); - - return; -} - static void decode_new(const char *test_name, const gnutls_datum_t *raw, const char *hex, int res) { int ret; @@ -309,7 +254,6 @@ void doit(void) } for (i=0;i<sizeof(decode_tests)/sizeof(decode_tests[0]);i++) { - decode(decode_tests[i].name, &decode_tests[i].raw, decode_tests[i].pem, decode_tests[i].res); decode_new(decode_tests[i].name, &decode_tests[i].raw, decode_tests[i].pem, decode_tests[i].res); } } |