mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +01:00
common: remove b64_decode
We don't use it, and it's buggy (will always return NULL) Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This commit is contained in:
parent
63b1ae54a1
commit
07bb931fed
2 changed files with 0 additions and 22 deletions
|
@ -14,24 +14,3 @@ char *b64_encode(const tal_t *ctx, const u8 *data, size_t len)
|
|||
len, sodium_base64_VARIANT_ORIGINAL);
|
||||
return str;
|
||||
}
|
||||
|
||||
u8 *b64_decode(const tal_t *ctx, const char *str, size_t len)
|
||||
{
|
||||
size_t bin_len = len + 1;
|
||||
|
||||
u8 *ret = tal_arr(ctx, u8, bin_len);
|
||||
|
||||
if (!sodium_base642bin(ret,
|
||||
tal_count(ret),
|
||||
(const char * const)str,
|
||||
len,
|
||||
NULL,
|
||||
&bin_len,
|
||||
NULL,
|
||||
sodium_base64_VARIANT_ORIGINAL))
|
||||
return tal_free(ret);
|
||||
|
||||
ret[bin_len] = 0;
|
||||
tal_resize(&ret, bin_len + 1);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,5 @@
|
|||
#include <ccan/tal/tal.h>
|
||||
|
||||
char *b64_encode(const tal_t *ctx, const u8 *data, size_t len);
|
||||
u8 *b64_decode(const tal_t *ctx, const char *str, size_t len);
|
||||
|
||||
#endif /* LIGHTNING_COMMON_BASE64_H */
|
||||
|
|
Loading…
Add table
Reference in a new issue