Skip to content

Commit ab830e5

Browse files
committed
remove unused EncodeBase64Secure
Also the hanging declaration of DecodeBase64Secure
1 parent 690c938 commit ab830e5

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

src/utilstrencodings.cpp

-27
Original file line numberDiff line numberDiff line change
@@ -193,33 +193,6 @@ std::string DecodeBase64(const std::string& str)
193193
return (vchRet.size() == 0) ? std::string() : std::string((const char*)&vchRet[0], vchRet.size());
194194
}
195195

196-
// Base64 encoding with secure memory allocation
197-
SecureString EncodeBase64Secure(const SecureString& input)
198-
{
199-
// Init openssl BIO with base64 filter and memory output
200-
BIO *b64, *mem;
201-
b64 = BIO_new(BIO_f_base64());
202-
BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); // No newlines in output
203-
mem = BIO_new(BIO_s_mem());
204-
BIO_push(b64, mem);
205-
206-
// Decode the string
207-
BIO_write(b64, &input[0], input.size());
208-
(void)BIO_flush(b64);
209-
210-
// Create output variable from buffer mem ptr
211-
BUF_MEM* bptr;
212-
BIO_get_mem_ptr(b64, &bptr);
213-
SecureString output(bptr->data, bptr->length);
214-
215-
// Cleanse secure data buffer from memory
216-
memory_cleanse((void*)bptr->data, bptr->length);
217-
218-
// Free memory
219-
BIO_free_all(b64);
220-
return output;
221-
}
222-
223196
std::string EncodeBase32(const unsigned char* pch, size_t len)
224197
{
225198
static const char *pbase32 = "abcdefghijklmnopqrstuvwxyz234567";

src/utilstrencodings.h

-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ std::vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid = NULL);
5656
std::string DecodeBase64(const std::string& str);
5757
std::string EncodeBase64(const unsigned char* pch, size_t len);
5858
std::string EncodeBase64(const std::string& str);
59-
SecureString DecodeBase64Secure(const SecureString& input);
60-
SecureString EncodeBase64Secure(const SecureString& input);
6159
std::vector<unsigned char> DecodeBase32(const char* p, bool* pfInvalid = NULL);
6260
std::string DecodeBase32(const std::string& str);
6361
std::string EncodeBase32(const unsigned char* pch, size_t len);

0 commit comments

Comments
 (0)