]> git.ipfire.org Git - people/ms/suricata.git/commit
util/crypt: Add macro for max base64encode len
authorShivani Bhardwaj <shivanib134@gmail.com>
Thu, 3 Dec 2020 11:25:39 +0000 (16:55 +0530)
committerVictor Julien <victor@inliniac.net>
Thu, 3 Dec 2020 14:17:38 +0000 (15:17 +0100)
commit02942a123a525bb1ed97bba9242f1e08d54f0fb8
treefaf2c5dd762c2793ac70bb82d870c5780f9c5ba0
parent057c4b34c8b1e64b850784f124e826180f3d9341
util/crypt: Add macro for max base64encode len

Maximum length of a base64 encoded string can be 33% over the actual
length of the input string. The formula to best cover all the edge cases
is mathematically
(4 * (input_length + 2) / 3) + 1

Add a macro to calculate this for a given input length.
src/util-crypt.h