Skip to content

Commit

Permalink
base: properly separate conv_base64 out of conv
Browse files Browse the repository at this point in the history
  • Loading branch information
prajnoha committed Sep 13, 2024
1 parent 35679be commit a310f70
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 28 deletions.
3 changes: 2 additions & 1 deletion src/base/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
File renamed without changes.
22 changes: 0 additions & 22 deletions src/base/conv.c

This file was deleted.

19 changes: 19 additions & 0 deletions src/include/base/conv-base64.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Base64 encoding/decoding (RFC1341)
* Copyright (c) 2005, Jouni Malinen <[email protected]>
*
* 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 <stddef.h>

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 */
6 changes: 1 addition & 5 deletions src/include/base/conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
#ifndef SID_CONV_H
#define SID_CONV_H

#include <stddef.h>

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 */

0 comments on commit a310f70

Please sign in to comment.