git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Copyright updates:
[exim.git]
/
src
/
src
/
base64.c
diff --git
a/src/src/base64.c
b/src/src/base64.c
index 6c8191462a9c8cd63c9c88c744b8590c6b638315..f14ecc30a0a0f48bd006b50a6d383422c1d005d8 100644
(file)
--- a/
src/src/base64.c
+++ b/
src/src/base64.c
@@
-2,10
+2,12
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
+/* Copyright (c) The Exim Maintainers 2020 - 2023 */
+/* Copyright (c) University of Cambridge 1995 - 2018 */
/* Copyright (c) Tom Kistner <tom@duncanthrax.net> 2004, 2015 */
/* License: GPL */
/* Copyright (c) Tom Kistner <tom@duncanthrax.net> 2004, 2015 */
/* License: GPL */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
-/* Copyright (c) University of Cambridge 1995 - 2018 */
/* See the file NOTICE for conditions of use and distribution. */
/* See the file NOTICE for conditions of use and distribution. */
@@
-150,16
+152,16
@@
static uschar dec64table[] = {
};
int
};
int
-b64decode(const uschar *
code, uschar **ptr
)
+b64decode(const uschar *
code, uschar ** ptr, const void * proto_mem
)
{
int x, y;
uschar *result;
{
int x, y;
uschar *result;
-{
+
{
int l = Ustrlen(code);
int l = Ustrlen(code);
- *ptr = result = store_get(1 + l/4 * 3 + l%4,
is_tainted(code)
);
-}
+ *ptr = result = store_get(1 + l/4 * 3 + l%4,
proto_mem
);
+
}
/* Each cycle of the loop handles a quantum of 4 input bytes. For the last
quantum this may decode to 1, 2, or 3 output bytes. */
/* Each cycle of the loop handles a quantum of 4 input bytes. For the last
quantum this may decode to 1, 2, or 3 output bytes. */
@@
-233,6
+235,7
@@
would probably run more slowly.
Arguments:
clear points to the clear text bytes
len the number of bytes to encode
Arguments:
clear points to the clear text bytes
len the number of bytes to encode
+ proto_mem taint indicator
Returns: a pointer to the zero-terminated base 64 string, which
is in working store
Returns: a pointer to the zero-terminated base 64 string, which
is in working store
@@
-242,10
+245,10
@@
static uschar *enc64table =
US"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
uschar *
US"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
uschar *
-b64encode
(const uschar * clear, int len
)
+b64encode
_taint(const uschar * clear, int len, const void * proto_mem
)
{
{
-uschar *
code = store_get(4*((len+2)/3) + 1, is_tainted(clear)
);
-uschar *p = code;
+uschar *
code = store_get(4*((len+2)/3) + 1, proto_mem
);
+uschar *
p = code;
while (len-- >0)
{
while (len-- >0)
{
@@
-283,6
+286,12
@@
while (len-- >0)
return code;
}
return code;
}
+uschar *
+b64encode(const uschar * clear, int len)
+{
+return b64encode_taint(clear, len, clear);
+}
+
/* End of base64.c */
/* vi: sw ai sw=2
/* End of base64.c */
/* vi: sw ai sw=2