#include <openssl/hmac.h>
#include <openssl/bio.h>
#include <openssl/sha.h>
#include <openssl/evp.h>
#include <openssl/buffer.h>
Go to the source code of this file.
|
| #define | xroad_base64_encode(_data, _len) |
| |
| #define | xroad_base64_decode(_str) |
| |
◆ xroad_base64_decode
| #define xroad_base64_decode |
( |
|
_str | ) |
|
Value:({ \
char* ret = alloca(_str.len); \
BIO* str64 = BIO_new_mem_buf(_str.data, _str.len); \
BIO* base64 = BIO_new(BIO_f_base64()); \
BIO* all = BIO_push(base64, str64); \
BIO_set_flags(all, BIO_FLAGS_BASE64_NO_NL); \
size_t len = BIO_read(all, ret, _str.len); \
BIO_free_all(base64); \
xroad_str_len(ret, len); \
})
◆ xroad_base64_encode
| #define xroad_base64_encode |
( |
|
_data, |
|
|
|
_len |
|
) |
| |
Value:({ \
BIO* base64 = BIO_new(BIO_f_base64()); \
BIO* b_mem = BIO_new(BIO_s_mem()); \
BIO* all = BIO_push(base64, b_mem); \
BIO_set_flags(all, BIO_FLAGS_BASE64_NO_NL); \
BIO_write(all, (_data), (_len)); \
(void)BIO_flush(all); \
BUF_MEM *bptr; \
BIO_get_mem_ptr(all, &bptr); \
BIO_free_all(all); \
ret; \
})
#define xroad_str_len(str, len)
Definition: xroad_string.h:213
#define xroad_str_dupa(str)
Definition: xroad_string.h:242