diff options
author | Valentin Bartenev <vbart@nginx.com> | 2021-10-26 15:43:44 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2021-10-26 15:43:44 +0300 |
commit | 7bf6253941d3b61e5eb3339fb5f68c84e9e68795 (patch) | |
tree | ff59b7a2c74d939c7eb3e08ef65246238bcb90d1 /src/nxt_string.h | |
parent | 7503cc96df4f8c5637ac90dcf6095d93fd03296f (diff) | |
download | unit-7bf6253941d3b61e5eb3339fb5f68c84e9e68795.tar.gz unit-7bf6253941d3b61e5eb3339fb5f68c84e9e68795.tar.bz2 |
Custom implementation of Base64 decoding function.
Compared to the previous implementation based on OpenSSL, the new implementation
has these advantages:
1. Strict and reliable detection of invalid strings, including strings with
less than 4 bytes of garbage at the end;
2. Allows to use Base64 strings without '=' padding.
Diffstat (limited to 'src/nxt_string.h')
-rw-r--r-- | src/nxt_string.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nxt_string.h b/src/nxt_string.h index 7e02f59a..4d565e87 100644 --- a/src/nxt_string.h +++ b/src/nxt_string.h @@ -190,6 +190,8 @@ NXT_EXPORT uintptr_t nxt_encode_complex_uri(u_char *dst, u_char *src, size_t length); NXT_EXPORT nxt_bool_t nxt_is_complex_uri_encoded(u_char *s, size_t length); +NXT_EXPORT ssize_t nxt_base64_decode(u_char *dst, u_char *src, size_t length); + extern const uint8_t nxt_hex2int[256]; |