From a310f705fd4941d475f70559186c7056f6a8f75c Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Fri, 13 Sep 2024 15:22:19 +0200 Subject: [PATCH] base: properly separate conv_base64 out of conv --- src/base/Makefile.am | 3 ++- src/base/{conv_base64.c => conv-base64.c} | 0 src/base/conv.c | 22 ---------------------- src/include/base/conv-base64.h | 19 +++++++++++++++++++ src/include/base/conv.h | 6 +----- 5 files changed, 22 insertions(+), 28 deletions(-) rename src/base/{conv_base64.c => conv-base64.c} (100%) delete mode 100644 src/base/conv.c create mode 100644 src/include/base/conv-base64.h diff --git a/src/base/Makefile.am b/src/base/Makefile.am index b2837dd0..0ecd2a37 100644 --- a/src/base/Makefile.am +++ b/src/base/Makefile.am @@ -25,7 +25,7 @@ libsidbase_la_SOURCES = buf-type-linear.c \ buf-type-vector.c \ buf.c \ comms.c \ - conv.c \ + conv-base64.c \ util.c basedir = $(pkgincludedir)/base @@ -34,6 +34,7 @@ base_HEADERS = $(top_srcdir)/src/include/base/buf-common.h \ $(top_srcdir)/src/include/base/buf-type.h \ $(top_srcdir)/src/include/base/buf.h \ $(top_srcdir)/src/include/base/comms.h \ + $(top_srcdir)/src/include/base/conv-base64.h \ $(top_srcdir)/src/include/base/conv.h \ $(top_srcdir)/src/include/base/util.h diff --git a/src/base/conv_base64.c b/src/base/conv-base64.c similarity index 100% rename from src/base/conv_base64.c rename to src/base/conv-base64.c diff --git a/src/base/conv.c b/src/base/conv.c deleted file mode 100644 index 8903b188..00000000 --- a/src/base/conv.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This file is part of SID. - * - * Copyright (C) 2017-2020 Red Hat, Inc. All rights reserved. - * - * SID is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * SID is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SID. If not, see . - */ - -#include "base/conv.h" - -#include "conv_base64.c" diff --git a/src/include/base/conv-base64.h b/src/include/base/conv-base64.h new file mode 100644 index 00000000..3f0edd95 --- /dev/null +++ b/src/include/base/conv-base64.h @@ -0,0 +1,19 @@ +/* + * Base64 encoding/decoding (RFC1341) + * Copyright (c) 2005, Jouni Malinen + * + * This software may be distributed under the terms of the BSD license. + * See BSD_LICENSE for more details. + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef SID_CONV_BASE64_H +#define SID_CONV_BASE64_H + +#include + +size_t sid_conv_base64_encoded_len(size_t in_len); +int sid_conv_base64_encode(const unsigned char *src, size_t len, unsigned char *dest, size_t out_len); +unsigned char *sid_conv_base64_decode(const unsigned char *src, size_t len, size_t *out_len); + +#endif /* SID_CONV_BASE64_H */ diff --git a/src/include/base/conv.h b/src/include/base/conv.h index 7c399f1b..96bce4ce 100644 --- a/src/include/base/conv.h +++ b/src/include/base/conv.h @@ -10,10 +10,6 @@ #ifndef SID_CONV_H #define SID_CONV_H -#include - -size_t sid_conv_base64_encoded_len(size_t in_len); -int sid_conv_base64_encode(const unsigned char *src, size_t len, unsigned char *dest, size_t out_len); -unsigned char *sid_conv_base64_decode(const unsigned char *src, size_t len, size_t *out_len); +#include "base/conv-base64.h" #endif /* SID_CONV_H */