diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-04-21 09:12:51 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-04-21 09:12:51 +0200 |
commit | c3cfbb3d7b1cc7233e292aa1a3f1af0316707713 (patch) | |
tree | 6e301ef03b56b78762640c3b719a4d1bc8cafc08 | |
parent | 89d4aeb37f7028a033334361eb14f2bef095dc75 (diff) | |
download | gnutls-c3cfbb3d7b1cc7233e292aa1a3f1af0316707713.tar.gz |
Revert "gnutls_pem_base64_decode: allow decoding raw base64 data"
This reverts commit fa86fc6892d6551340f24da6a6af4f484a62b884.
-rw-r--r-- | lib/x509_b64.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/x509_b64.c b/lib/x509_b64.c index 49b25e2c97..e5a741a868 100644 --- a/lib/x509_b64.c +++ b/lib/x509_b64.c @@ -302,19 +302,12 @@ _gnutls_fbase64_decode(const char *header, const uint8_t * data, int rdata_size; char pem_header[128]; - if (header == NULL) { - if ((ret = _gnutls_base64_decode(data, data_size, result)) < 0) { - gnutls_assert(); - return GNUTLS_E_BASE64_DECODING_ERROR; - } - return 0; - } - _gnutls_str_cpy(pem_header, sizeof(pem_header), top); if (header != NULL) _gnutls_str_cat(pem_header, sizeof(pem_header), header); rdata = memmem(data, data_size, pem_header, strlen(pem_header)); + if (rdata == NULL) { gnutls_assert(); _gnutls_hard_log("Could not find '%s'\n", pem_header); @@ -379,10 +372,6 @@ _gnutls_fbase64_decode(const char *header, const uint8_t * data, * and decode only this part. Otherwise it will decode the first PEM * packet found. * - * To decode data from any arbitrary header set the null string as header. - * Since 3.6.0 this function will decode arbitrary base64 without any - * headers when %NULL is given as header. - * * Returns: On success %GNUTLS_E_SUCCESS (0) is returned, * %GNUTLS_E_SHORT_MEMORY_BUFFER is returned if the buffer given is * not long enough, or 0 on success. @@ -432,10 +421,6 @@ gnutls_pem_base64_decode(const char *header, * under the name gnutls_pem_base64_decode_alloc(). There is * compatibility macro pointing to this function. * - * To decode data from any arbitrary header set the null string as header. - * Since 3.6.0 this function will decode arbitrary base64 without any - * headers when %NULL is given as header. - * * Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise * an error code is returned. * |