1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-06 09:40:41 +03:00
SoftEtherVPN/src/Mayaqua/Encoding.h
Davide Beatrici 233e28f38c Refactor Base64 functions, encode/decode using OpenSSL's EVP interface
Our own implementation works fine, however we should use OpenSSL's one since we already link to the library.

Base64Decode() and Base64Encode() return the required buffer size when "dst" is NULL.

This allows to efficiently allocate a buffer, without wasting memory or risking an overflow.

Base64FromBin() and Base64ToBin() perform all steps, returning a heap-allocated buffer with the data in it.
2021-07-02 09:24:41 +02:00

10 lines
198 B
C

#ifndef ENCODING_H
#define ENCODING_H
#include "MayaType.h"
UINT Base64Decode(void *dst, const void *src, const UINT size);
UINT Base64Encode(void *dst, const void *src, const UINT size);
#endif