diff options
8 files changed, 337 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/libb64/libb64/0001-example-Do-not-run-the-tests.patch b/meta-oe/recipes-support/libb64/libb64/0001-example-Do-not-run-the-tests.patch new file mode 100644 index 0000000000..ea3ddfb64b --- /dev/null +++ b/meta-oe/recipes-support/libb64/libb64/0001-example-Do-not-run-the-tests.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From 68f66d1583be670eb8d5f3f38dbd5dd1d63b733c Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 27 Mar 2021 21:41:04 -0700 | ||
4 | Subject: [PATCH] example: Do not run the tests | ||
5 | |||
6 | Upstream-Status: Inappropritate [Cross-compile specific] | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | --- | ||
9 | examples/Makefile | 3 --- | ||
10 | 1 file changed, 3 deletions(-) | ||
11 | |||
12 | diff --git a/examples/Makefile b/examples/Makefile | ||
13 | index d9667a5..554b346 100644 | ||
14 | --- a/examples/Makefile | ||
15 | +++ b/examples/Makefile | ||
16 | @@ -33,11 +33,8 @@ depend: $(SOURCES) | ||
17 | makedepend -f- $(CFLAGS) $(SOURCES) 2> /dev/null 1> depend | ||
18 | |||
19 | test-c-example1: c-example1 | ||
20 | - ./c-example1 | ||
21 | |||
22 | test-c-example2: c-example2 | ||
23 | - ./c-example2 loremgibson.txt encoded.txt decoded.txt | ||
24 | - diff -q loremgibson.txt decoded.txt | ||
25 | |||
26 | test: test-c-example1 test-c-example2 | ||
27 | |||
diff --git a/meta-oe/recipes-support/libb64/libb64/0002-use-BUFSIZ-as-buffer-size.patch b/meta-oe/recipes-support/libb64/libb64/0002-use-BUFSIZ-as-buffer-size.patch new file mode 100644 index 0000000000..10ec8e14a8 --- /dev/null +++ b/meta-oe/recipes-support/libb64/libb64/0002-use-BUFSIZ-as-buffer-size.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From ee03e265804a07a0da5028b86960031bd7ab86b2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 27 Mar 2021 22:01:13 -0700 | ||
4 | Subject: [PATCH] use BUFSIZ as buffer size | ||
5 | |||
6 | Author: Jakub Wilk <jwilk@debian.org> | ||
7 | Bug: http://sourceforge.net/tracker/?func=detail&atid=785907&aid=3591336&group_id=152942 | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | include/b64/decode.h | 3 ++- | ||
13 | include/b64/encode.h | 3 ++- | ||
14 | 2 files changed, 4 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/include/b64/decode.h b/include/b64/decode.h | ||
17 | index 12b16ea..e9019f3 100644 | ||
18 | --- a/include/b64/decode.h | ||
19 | +++ b/include/b64/decode.h | ||
20 | @@ -8,6 +8,7 @@ For details, see http://sourceforge.net/projects/libb64 | ||
21 | #ifndef BASE64_DECODE_H | ||
22 | #define BASE64_DECODE_H | ||
23 | |||
24 | +#include <cstdio> | ||
25 | #include <iostream> | ||
26 | |||
27 | namespace base64 | ||
28 | @@ -22,7 +23,7 @@ namespace base64 | ||
29 | base64_decodestate _state; | ||
30 | int _buffersize; | ||
31 | |||
32 | - decoder(int buffersize_in = BUFFERSIZE) | ||
33 | + decoder(int buffersize_in = BUFSIZ) | ||
34 | : _buffersize(buffersize_in) | ||
35 | {} | ||
36 | |||
37 | diff --git a/include/b64/encode.h b/include/b64/encode.h | ||
38 | index 5d807d9..e7a7035 100644 | ||
39 | --- a/include/b64/encode.h | ||
40 | +++ b/include/b64/encode.h | ||
41 | @@ -8,6 +8,7 @@ For details, see http://sourceforge.net/projects/libb64 | ||
42 | #ifndef BASE64_ENCODE_H | ||
43 | #define BASE64_ENCODE_H | ||
44 | |||
45 | +#include <cstdio> | ||
46 | #include <iostream> | ||
47 | |||
48 | namespace base64 | ||
49 | @@ -22,7 +23,7 @@ namespace base64 | ||
50 | base64_encodestate _state; | ||
51 | int _buffersize; | ||
52 | |||
53 | - encoder(int buffersize_in = BUFFERSIZE) | ||
54 | + encoder(int buffersize_in = BUFSIZ) | ||
55 | : _buffersize(buffersize_in) | ||
56 | {} | ||
57 | |||
diff --git a/meta-oe/recipes-support/libb64/libb64/0003-fix-integer-overflows.patch b/meta-oe/recipes-support/libb64/libb64/0003-fix-integer-overflows.patch new file mode 100644 index 0000000000..8854bb6af4 --- /dev/null +++ b/meta-oe/recipes-support/libb64/libb64/0003-fix-integer-overflows.patch | |||
@@ -0,0 +1,77 @@ | |||
1 | From 7b30fbc3d47dfaf38d8ce8b8949a69d2984dac76 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 27 Mar 2021 22:06:03 -0700 | ||
4 | Subject: [PATCH] fix integer overflows | ||
5 | |||
6 | Author: Jakub Wilk <jwilk@debian.org> | ||
7 | Bug: http://sourceforge.net/tracker/?func=detail&aid=3591129&group_id=152942&atid=785907 | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | src/cdecode.c | 15 ++++++++------- | ||
13 | 1 file changed, 8 insertions(+), 7 deletions(-) | ||
14 | |||
15 | diff --git a/src/cdecode.c b/src/cdecode.c | ||
16 | index a6c0a42..4e47e9f 100644 | ||
17 | --- a/src/cdecode.c | ||
18 | +++ b/src/cdecode.c | ||
19 | @@ -9,10 +9,11 @@ For details, see http://sourceforge.net/projects/libb64 | ||
20 | |||
21 | int base64_decode_value(char value_in) | ||
22 | { | ||
23 | - static const char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; | ||
24 | + static const signed char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; | ||
25 | static const char decoding_size = sizeof(decoding); | ||
26 | + if (value_in < 43) return -1; | ||
27 | value_in -= 43; | ||
28 | - if (value_in < 0 || value_in >= decoding_size) return -1; | ||
29 | + if (value_in > decoding_size) return -1; | ||
30 | return decoding[(int)value_in]; | ||
31 | } | ||
32 | |||
33 | @@ -26,7 +27,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex | ||
34 | { | ||
35 | const char* codechar = code_in; | ||
36 | char* plainchar = plaintext_out; | ||
37 | - char fragment; | ||
38 | + int fragment; | ||
39 | |||
40 | *plainchar = state_in->plainchar; | ||
41 | |||
42 | @@ -42,7 +43,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex | ||
43 | state_in->plainchar = *plainchar; | ||
44 | return plainchar - plaintext_out; | ||
45 | } | ||
46 | - fragment = (char)base64_decode_value(*codechar++); | ||
47 | + fragment = base64_decode_value(*codechar++); | ||
48 | } while (fragment < 0); | ||
49 | *plainchar = (fragment & 0x03f) << 2; | ||
50 | case step_b: | ||
51 | @@ -53,7 +54,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex | ||
52 | state_in->plainchar = *plainchar; | ||
53 | return plainchar - plaintext_out; | ||
54 | } | ||
55 | - fragment = (char)base64_decode_value(*codechar++); | ||
56 | + fragment = base64_decode_value(*codechar++); | ||
57 | } while (fragment < 0); | ||
58 | *plainchar++ |= (fragment & 0x030) >> 4; | ||
59 | *plainchar = (fragment & 0x00f) << 4; | ||
60 | @@ -65,7 +66,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex | ||
61 | state_in->plainchar = *plainchar; | ||
62 | return plainchar - plaintext_out; | ||
63 | } | ||
64 | - fragment = (char)base64_decode_value(*codechar++); | ||
65 | + fragment = base64_decode_value(*codechar++); | ||
66 | } while (fragment < 0); | ||
67 | *plainchar++ |= (fragment & 0x03c) >> 2; | ||
68 | *plainchar = (fragment & 0x003) << 6; | ||
69 | @@ -77,7 +78,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex | ||
70 | state_in->plainchar = *plainchar; | ||
71 | return plainchar - plaintext_out; | ||
72 | } | ||
73 | - fragment = (char)base64_decode_value(*codechar++); | ||
74 | + fragment = base64_decode_value(*codechar++); | ||
75 | } while (fragment < 0); | ||
76 | *plainchar++ |= (fragment & 0x03f); | ||
77 | } | ||
diff --git a/meta-oe/recipes-support/libb64/libb64/0004-Fix-off-by-one-error.patch b/meta-oe/recipes-support/libb64/libb64/0004-Fix-off-by-one-error.patch new file mode 100644 index 0000000000..e19dbad08d --- /dev/null +++ b/meta-oe/recipes-support/libb64/libb64/0004-Fix-off-by-one-error.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From 8144fd9e02bd5ccd1e080297b19a1e9eb4d3ff96 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 27 Mar 2021 22:07:15 -0700 | ||
4 | Subject: [PATCH] Fix off by one error | ||
5 | |||
6 | Launchpad bug #1501176 reported by William McCall on 2015-09-30 | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | src/cdecode.c | 2 +- | ||
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/src/cdecode.c b/src/cdecode.c | ||
15 | index 4e47e9f..45da4e1 100644 | ||
16 | --- a/src/cdecode.c | ||
17 | +++ b/src/cdecode.c | ||
18 | @@ -13,7 +13,7 @@ int base64_decode_value(char value_in) | ||
19 | static const char decoding_size = sizeof(decoding); | ||
20 | if (value_in < 43) return -1; | ||
21 | value_in -= 43; | ||
22 | - if (value_in > decoding_size) return -1; | ||
23 | + if (value_in >= decoding_size) return -1; | ||
24 | return decoding[(int)value_in]; | ||
25 | } | ||
26 | |||
diff --git a/meta-oe/recipes-support/libb64/libb64/0005-make-overriding-CFLAGS-possible.patch b/meta-oe/recipes-support/libb64/libb64/0005-make-overriding-CFLAGS-possible.patch new file mode 100644 index 0000000000..e93015ee48 --- /dev/null +++ b/meta-oe/recipes-support/libb64/libb64/0005-make-overriding-CFLAGS-possible.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From a7914d5ffee6ffdfb3f2b8ebcc22c8367d078301 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 27 Mar 2021 22:08:43 -0700 | ||
4 | Subject: [PATCH] make overriding CFLAGS possible | ||
5 | |||
6 | Author: Jakub Wilk <jwilk@debian.org> | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | base64/Makefile | 2 +- | ||
12 | src/Makefile | 2 +- | ||
13 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/base64/Makefile b/base64/Makefile | ||
16 | index 30a2c5c..783a248 100644 | ||
17 | --- a/base64/Makefile | ||
18 | +++ b/base64/Makefile | ||
19 | @@ -3,7 +3,7 @@ BINARIES = base64 | ||
20 | # Build flags (uncomment one) | ||
21 | ############################# | ||
22 | # Release build flags | ||
23 | -CFLAGS += -O3 | ||
24 | +CFLAGS ?= -O3 | ||
25 | ############################# | ||
26 | # Debug build flags | ||
27 | #CFLAGS += -g | ||
28 | diff --git a/src/Makefile b/src/Makefile | ||
29 | index 28b2382..48801fc 100644 | ||
30 | --- a/src/Makefile | ||
31 | +++ b/src/Makefile | ||
32 | @@ -3,7 +3,7 @@ LIBRARIES = libb64.a | ||
33 | # Build flags (uncomment one) | ||
34 | ############################# | ||
35 | # Release build flags | ||
36 | -CFLAGS += -O3 | ||
37 | +CFLAGS ?= -O3 | ||
38 | ############################# | ||
39 | # Debug build flags | ||
40 | #CFLAGS += -g | ||
diff --git a/meta-oe/recipes-support/libb64/libb64/0006-do-not-export-the-CHARS_PER_LINE-variable.patch b/meta-oe/recipes-support/libb64/libb64/0006-do-not-export-the-CHARS_PER_LINE-variable.patch new file mode 100644 index 0000000000..9ba08c87ee --- /dev/null +++ b/meta-oe/recipes-support/libb64/libb64/0006-do-not-export-the-CHARS_PER_LINE-variable.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From a1b9bb4af819ed389675f16e4a521efeda4cc3f3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 27 Mar 2021 22:10:48 -0700 | ||
4 | Subject: [PATCH] do not export the CHARS_PER_LINE variable | ||
5 | |||
6 | The library exports a variable named "CHARS_PER_LINE". This is a generic name that could conflict with a name in user's code. | ||
7 | Please either rename the variable or make it static. | ||
8 | |||
9 | Upstream-Status: Submitted [http://sourceforge.net/tracker/?func=detail&aid=3591420&group_id=152942&atid=785907] | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | src/cencode.c | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/src/cencode.c b/src/cencode.c | ||
16 | index 03ba5b6..3df62a8 100644 | ||
17 | --- a/src/cencode.c | ||
18 | +++ b/src/cencode.c | ||
19 | @@ -7,7 +7,7 @@ For details, see http://sourceforge.net/projects/libb64 | ||
20 | |||
21 | #include <b64/cencode.h> | ||
22 | |||
23 | -const int CHARS_PER_LINE = 72; | ||
24 | +static const int CHARS_PER_LINE = 72; | ||
25 | |||
26 | void base64_init_encodestate(base64_encodestate* state_in) | ||
27 | { | ||
diff --git a/meta-oe/recipes-support/libb64/libb64/0007-initialize-encoder-decoder-state-in-the-constructors.patch b/meta-oe/recipes-support/libb64/libb64/0007-initialize-encoder-decoder-state-in-the-constructors.patch new file mode 100644 index 0000000000..fdf8339bed --- /dev/null +++ b/meta-oe/recipes-support/libb64/libb64/0007-initialize-encoder-decoder-state-in-the-constructors.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From c1ba44d83cc7d9d756cfb063717852eae9d03328 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 27 Mar 2021 22:12:41 -0700 | ||
4 | Subject: [PATCH] initialize encoder/decoder state in the constructors | ||
5 | |||
6 | Author: Jakub Wilk <jwilk@debian.org> | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | include/b64/decode.h | 4 +++- | ||
12 | include/b64/encode.h | 4 +++- | ||
13 | 2 files changed, 6 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/include/b64/decode.h b/include/b64/decode.h | ||
16 | index e9019f3..aefb7bc 100644 | ||
17 | --- a/include/b64/decode.h | ||
18 | +++ b/include/b64/decode.h | ||
19 | @@ -25,7 +25,9 @@ namespace base64 | ||
20 | |||
21 | decoder(int buffersize_in = BUFSIZ) | ||
22 | : _buffersize(buffersize_in) | ||
23 | - {} | ||
24 | + { | ||
25 | + base64_init_decodestate(&_state); | ||
26 | + } | ||
27 | |||
28 | int decode(char value_in) | ||
29 | { | ||
30 | diff --git a/include/b64/encode.h b/include/b64/encode.h | ||
31 | index e7a7035..33848b3 100644 | ||
32 | --- a/include/b64/encode.h | ||
33 | +++ b/include/b64/encode.h | ||
34 | @@ -25,7 +25,9 @@ namespace base64 | ||
35 | |||
36 | encoder(int buffersize_in = BUFSIZ) | ||
37 | : _buffersize(buffersize_in) | ||
38 | - {} | ||
39 | + { | ||
40 | + base64_init_encodestate(&_state); | ||
41 | + } | ||
42 | |||
43 | int encode(char value_in) | ||
44 | { | ||
diff --git a/meta-oe/recipes-support/libb64/libb64_1.2.1.bb b/meta-oe/recipes-support/libb64/libb64_1.2.1.bb new file mode 100644 index 0000000000..64a34fece7 --- /dev/null +++ b/meta-oe/recipes-support/libb64/libb64_1.2.1.bb | |||
@@ -0,0 +1,39 @@ | |||
1 | SUMMARY = "Base64 Encoding/Decoding Routines" | ||
2 | DESCRIPTION = "base64 encoding/decoding library - runtime library \ | ||
3 | libb64 is a library of ANSI C routines for fast encoding/decoding data into \ | ||
4 | and from a base64-encoded format" | ||
5 | HOMEPAGE = "http://libb64.sourceforge.net/" | ||
6 | LICENSE = "PD" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=ce551aad762074c7ab618a0e07a8dca3" | ||
8 | |||
9 | SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}/${BP}.zip \ | ||
10 | file://0001-example-Do-not-run-the-tests.patch \ | ||
11 | file://0002-use-BUFSIZ-as-buffer-size.patch \ | ||
12 | file://0003-fix-integer-overflows.patch \ | ||
13 | file://0004-Fix-off-by-one-error.patch \ | ||
14 | file://0005-make-overriding-CFLAGS-possible.patch \ | ||
15 | file://0006-do-not-export-the-CHARS_PER_LINE-variable.patch \ | ||
16 | file://0007-initialize-encoder-decoder-state-in-the-constructors.patch \ | ||
17 | " | ||
18 | SRC_URI[sha256sum] = "20106f0ba95cfd9c35a13c71206643e3fb3e46512df3e2efb2fdbf87116314b2" | ||
19 | |||
20 | PARALLEL_MAKE = "" | ||
21 | |||
22 | CFLAGS += "-fPIC" | ||
23 | |||
24 | do_configure () { | ||
25 | : | ||
26 | } | ||
27 | |||
28 | do_compile () { | ||
29 | oe_runmake | ||
30 | ${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,${BPN}.so.0 src/*.o -o src/${BPN}.so.0 | ||
31 | } | ||
32 | |||
33 | do_install () { | ||
34 | install -d ${D}${includedir}/b64 | ||
35 | install -Dm 0644 ${B}/src/libb64.a ${D}${libdir}/libb64.a | ||
36 | install -Dm 0644 ${B}/src/libb64.so.0 ${D}${libdir}/libb64.so.0 | ||
37 | ln -s libb64.so.0 ${D}${libdir}/libb64.so | ||
38 | install -Dm 0644 ${S}/include/b64/*.h ${D}${includedir}/b64/ | ||
39 | } | ||