summaryrefslogtreecommitdiff
path: root/src/base64.c
Commit message (Collapse)AuthorAgeFilesLines
* [core] fix li_base64_dec() on whitespaceGlenn Strauss2022-07-011-7/+8
| | | | | | | | (regression in lighttpd 1.4.60 - lighttpd 1.4.65) impacted: mod_wolfssl loading certificate private keys must ignore whitespace in count of encoded chars
* [core] base64url pad char is '='; change from '.'Glenn Strauss2021-09-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | RFC4648 base64url pad char is '='; change from '.' in lighttpd The base64url encoding was introduced in lighttpd 1.4.38 in 2015, but at the time, does not appear to have been used in base64url decoding where padding might be present. In lighttpd 1.4.50, base64url decoding was possible with %{decb64u:...} potentially used in mod_redirect and mod_rewrite rules. However, this is not believed to be widely used, and even if used, it is strongly recommended that the URLs contain a base64url-encoded string WITHOUT padding, since padding of '=' might be %-encoded and require decoding before base64url-decoding. Note: this change may affect %{decb64u:...} substitution in mod_redirect and mod_rewrite, but *ONLY* in case where URL contains a base64url-encoded string *WITH* padding, and that padding had been created specifically for use with lighttpd, using '.' as padding char x-ref: RFC4648 https://datatracker.ietf.org/doc/html/rfc4648#section-5
* [core] li_base64_dec()Glenn Strauss2021-08-271-1/+1
| | | | (make public in base64.h, like li_base64_enc())
* [core] load padding char from base64_tableGlenn Strauss2021-05-201-12/+1
| | | | (triggers preload-access of table)
* [core] li_base64_dec() on 4 bytes at a timeGlenn Strauss2021-05-201-68/+48
|
* [core] merge base64 encoding to li_base64_enc()Glenn Strauss2021-05-191-24/+18
| | | | single func with option to add padding or not
* [core] base64 encode w/ reduced data dependenciesGlenn Strauss2021-05-191-12/+13
|
* [core] base64 encode round-up for required spaceGlenn Strauss2021-05-181-11/+6
| | | | | | | no need for extra work for precision allocation to avoid 0-3 extra chars note: callers passing precise buffer size for without padding will need to be modified to pass a slightly larger buffer, e.g. mod_secdownload
* [core] consolidate overflow checks in li_to_base64Glenn Strauss2021-05-061-3/+5
|
* [core] base64_charset enum supports only 2 tablesGlenn Strauss2021-05-061-24/+6
|
* [core] buffer_append_base64_encode_opt()Glenn Strauss2021-05-061-15/+8
| | | | | | | | with option to include or omit padding single func to handle both: - buffer_append_base64_encode_no_padding - buffer_append_base64_encode
* [core] li_to_base64 alt code to add paddingGlenn Strauss2021-05-061-28/+25
|
* [core] li_base64_decode mark cold code pathGlenn Strauss2021-05-061-15/+13
|
* [core] li_base64_decode similar to li_to_base64Glenn Strauss2021-05-061-13/+21
|
* [multiple] correct misspellings in commentsGlenn Strauss2020-07-081-1/+1
| | | | | | x-ref: "Script for fixing spelling errors with codespell" https://redmine.lighttpd.net/boards/3/topics/8947
* [core] fix base64 decode when char is unsigned (fixes #2848)Glenn Strauss2017-12-211-3/+3
| | | | | | | | thx, codehero x-ref: "buffer_append_base64_decode() broken on compilers where char is assumed unsigned" https://redmine.lighttpd.net/issues/2848
* [unittests] consolidate base64 test codeGlenn Strauss2017-10-031-6/+6
| | | | | | | consolidate base64 test code use char type for tables to reduce memory use (potentially increase cache hits)
* [base64] fix another crash due to broken force_assert conditionsStefan Bühler2016-03-251-2/+2
| | | | | | From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3119 152afb58-edef-0310-8abb-c4023f1b3aa9
* [base64] fix crash due to broken force_assertAndrey Mnatsakanov2016-03-231-1/+1
| | | | | | | | | | if the input to `li_to_base64_no_padding` has length 3*n, `out_tuple_remainder` = `in_tuple_remainder` = 0, and `4*full_tuples == 4*full_tuples + out_tuple_remainder` From: Andrey Mnatsakanov <andrey.mnatsakanov@gmail.com> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3117 152afb58-edef-0310-8abb-c4023f1b3aa9
* consistent inclusion of config.h at top of files (fixes #2073)Glenn Strauss2016-03-191-0/+2
| | | | | | From: Glenn Strauss <gstrauss@gluelogic.com> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3113 152afb58-edef-0310-8abb-c4023f1b3aa9
* [core] refactor base64 functions into separate fileStefan Bühler2015-11-221-0/+233
Differential Revision: https://review.lighttpd.net/D6 From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3053 152afb58-edef-0310-8abb-c4023f1b3aa9