diff options
author | Harald Welte <laforge@osmocom.org> | 2021-09-17 08:35:32 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2021-09-21 19:57:56 +0000 |
commit | 292f9e7014056125f9abadd8df1b2850141bc6c0 (patch) | |
tree | 7b6e407d2c015b60deace051baa4b55dddbf9cc8 /include | |
parent | c757239fd371727ad085d25032038306d8d57726 (diff) |
base64: Migrate over to osmocom
This containts the osmocom changes to the mbedtls base64 code
merged in the previous commit.
Change-Id: I82c1bf5f827c8def370dbcb80b146e9e4184c4a3
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 1 | ||||
-rw-r--r-- | include/osmocom/core/base64.h | 19 |
2 files changed, 4 insertions, 16 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index e25ed48e..7df651aa 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -6,6 +6,7 @@ nobase_include_HEADERS = \ osmocom/codec/gsm610_bits.h \ osmocom/core/application.h \ osmocom/core/backtrace.h \ + osmocom/core/base64.h \ osmocom/core/bit16gen.h \ osmocom/core/bit32gen.h \ osmocom/core/bit64gen.h \ diff --git a/include/osmocom/core/base64.h b/include/osmocom/core/base64.h index 0f7233d2..f73db0d8 100644 --- a/include/osmocom/core/base64.h +++ b/include/osmocom/core/base64.h @@ -21,14 +21,10 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MBEDTLS_BASE64_H -#define MBEDTLS_BASE64_H +#pragma once #include <stddef.h> -#define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */ -#define MBEDTLS_ERR_BASE64_INVALID_CHARACTER -0x002C /**< Invalid character in input. */ - #ifdef __cplusplus extern "C" { #endif @@ -49,7 +45,7 @@ extern "C" { * \note Call this function with dlen = 0 to obtain the * required buffer size in *olen */ -int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen, +int osmo_base64_encode( unsigned char *dst, size_t dlen, size_t *olen, const unsigned char *src, size_t slen ); /** @@ -69,18 +65,9 @@ int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen, * \note Call this function with *dst = NULL or dlen = 0 to obtain * the required buffer size in *olen */ -int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen, +int osmo_base64_decode( unsigned char *dst, size_t dlen, size_t *olen, const unsigned char *src, size_t slen ); -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_base64_self_test( int verbose ); - #ifdef __cplusplus } #endif - -#endif /* base64.h */ |