diff options
4 files changed, 204 insertions, 0 deletions
diff --git a/meta/packages/gnutls/gnutls-2.4.2/configure_madness.patch b/meta/packages/gnutls/gnutls-2.4.2/configure_madness.patch new file mode 100644 index 0000000000..19b6b498b4 --- /dev/null +++ b/meta/packages/gnutls/gnutls-2.4.2/configure_madness.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | --- | ||
2 | configure.in | 8 ++++---- | ||
3 | lib/gnutls.pc.in | 3 ++- | ||
4 | libextra/gnutls-extra.pc.in | 3 ++- | ||
5 | 3 files changed, 8 insertions(+), 6 deletions(-) | ||
6 | |||
7 | --- gnutls-2.4.0.orig/configure.in | ||
8 | +++ gnutls-2.4.0/configure.in | ||
9 | @@ -637,17 +637,17 @@ AC_MSG_RESULT([*** | ||
10 | *** Detecting options for shared libraries... | ||
11 | ]) | ||
12 | AC_LIBTOOL_WIN32_DLL | ||
13 | AC_PROG_LIBTOOL | ||
14 | |||
15 | -LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBTASN1_LIBS $LIBGCRYPT_LIBS $LIBS" | ||
16 | -LIBGNUTLS_CFLAGS="$LIBGCRYPT_CFLAGS $LIBTASN1_CFLAGS -I${includedir}" | ||
17 | +LIBGNUTLS_LIBS="-lgnutls $LIBTASN1_LIBS $LIBGCRYPT_LIBS $LIBS" | ||
18 | +LIBGNUTLS_CFLAGS="$LIBGCRYPT_CFLAGS $LIBTASN1_CFLAGS" | ||
19 | AC_SUBST(LIBGNUTLS_LIBS) | ||
20 | AC_SUBST(LIBGNUTLS_CFLAGS) | ||
21 | |||
22 | -LIBGNUTLS_EXTRA_LIBS="-L${libdir} -lgnutls-extra $LZO_LIBS $LIBGNUTLS_LIBS" | ||
23 | -LIBGNUTLS_EXTRA_CFLAGS="-I${includedir}" | ||
24 | +LIBGNUTLS_EXTRA_LIBS=" -lgnutls-extra $LZO_LIBS $LIBGNUTLS_LIBS" | ||
25 | +LIBGNUTLS_EXTRA_CFLAGS="" | ||
26 | AC_SUBST(LIBGNUTLS_EXTRA_LIBS) | ||
27 | AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS) | ||
28 | export ac_full | ||
29 | |||
30 | AM_CFLAGS="${AM_CFLAGS} ${LIBGCRYPT_CFLAGS}" | ||
31 | --- gnutls-2.4.0.orig/lib/gnutls.pc.in | ||
32 | +++ gnutls-2.4.0/lib/gnutls.pc.in | ||
33 | @@ -16,8 +16,9 @@ libdir=@libdir@ | ||
34 | includedir=@includedir@ | ||
35 | |||
36 | Name: GnuTLS | ||
37 | Description: Transport Security Layer implementation for the GNU system | ||
38 | Version: @VERSION@ | ||
39 | +Requires.private: libgcrypt | ||
40 | Libs: -L${libdir} -lgnutls | ||
41 | -Libs.private: @LIBGNUTLS_LIBS@ | ||
42 | +Libs.private: -L${libdir} -lgnutls | ||
43 | Cflags: -I${includedir} | ||
44 | --- gnutls-2.4.0.orig/libextra/gnutls-extra.pc.in | ||
45 | +++ gnutls-2.4.0/libextra/gnutls-extra.pc.in | ||
46 | @@ -16,9 +16,10 @@ libdir=@libdir@ | ||
47 | includedir=@includedir@ | ||
48 | |||
49 | Name: GnuTLS-extra | ||
50 | Description: Additional add-ons for GnuTLS licensed under GPL | ||
51 | Requires: gnutls | ||
52 | +Requires.private: gnutls | ||
53 | Version: @VERSION@ | ||
54 | Libs: -L${libdir} -lgnutls-extra | ||
55 | -Libs.private: @LIBGNUTLS_EXTRA_LIBS@ | ||
56 | +Libs.private: -L${libdir} -lgnutls-extra | ||
57 | Cflags: -I${includedir} | ||
diff --git a/meta/packages/gnutls/gnutls-2.4.2/gnutls-openssl.patch b/meta/packages/gnutls/gnutls-2.4.2/gnutls-openssl.patch new file mode 100644 index 0000000000..e2c189592f --- /dev/null +++ b/meta/packages/gnutls/gnutls-2.4.2/gnutls-openssl.patch | |||
@@ -0,0 +1,124 @@ | |||
1 | Index: gnutls-1.6.0/libextra/gnutls_openssl.c | ||
2 | =================================================================== | ||
3 | --- gnutls-1.6.0.orig/libextra/gnutls_openssl.c 2006-08-13 22:34:09.000000000 +0200 | ||
4 | +++ gnutls-1.6.0/libextra/gnutls_openssl.c 2006-12-12 15:07:59.002227000 +0100 | ||
5 | @@ -256,12 +256,17 @@ | ||
6 | ssl->rfd = (gnutls_transport_ptr_t) - 1; | ||
7 | ssl->wfd = (gnutls_transport_ptr_t) - 1; | ||
8 | |||
9 | + ssl->ssl_peek_buffer = NULL; | ||
10 | + ssl->ssl_peek_buffer_size = ssl->ssl_peek_avail = 0; | ||
11 | + | ||
12 | return ssl; | ||
13 | } | ||
14 | |||
15 | void | ||
16 | SSL_free (SSL * ssl) | ||
17 | { | ||
18 | + if (ssl->ssl_peek_buffer) | ||
19 | + free(ssl->ssl_peek_buffer); | ||
20 | gnutls_certificate_free_credentials (ssl->gnutls_cred); | ||
21 | gnutls_deinit (ssl->gnutls_state); | ||
22 | free (ssl); | ||
23 | @@ -285,6 +290,7 @@ | ||
24 | SSL_set_fd (SSL * ssl, int fd) | ||
25 | { | ||
26 | gnutls_transport_set_ptr (ssl->gnutls_state, GNUTLS_INT_TO_POINTER (fd)); | ||
27 | + ssl->rfd = ssl->wfd = fd; | ||
28 | return 1; | ||
29 | } | ||
30 | |||
31 | @@ -310,6 +316,17 @@ | ||
32 | return 1; | ||
33 | } | ||
34 | |||
35 | +int SSL_get_rfd(SSL *ssl) | ||
36 | +{ | ||
37 | + return ssl->rfd; | ||
38 | +} | ||
39 | + | ||
40 | +int SSL_get_wfd(SSL *ssl) | ||
41 | +{ | ||
42 | + return ssl->wfd; | ||
43 | +} | ||
44 | + | ||
45 | + | ||
46 | void | ||
47 | SSL_set_bio (SSL * ssl, BIO * rbio, BIO * wbio) | ||
48 | { | ||
49 | @@ -325,6 +342,8 @@ | ||
50 | int | ||
51 | SSL_pending (SSL * ssl) | ||
52 | { | ||
53 | + if (ssl->ssl_peek_avail) | ||
54 | + return ssl->ssl_peek_avail; | ||
55 | return gnutls_record_check_pending (ssl->gnutls_state); | ||
56 | } | ||
57 | |||
58 | @@ -480,11 +499,50 @@ | ||
59 | return 1; | ||
60 | } | ||
61 | |||
62 | +int SSL_peek(SSL *ssl, void *buf, int len) | ||
63 | +{ | ||
64 | + if (len > ssl->ssl_peek_buffer_size) { | ||
65 | + ssl->ssl_peek_buffer = realloc (ssl->ssl_peek_buffer, len); | ||
66 | + ssl->ssl_peek_buffer_size = len; | ||
67 | + } | ||
68 | + | ||
69 | + if (ssl->ssl_peek_avail == 0) { | ||
70 | + | ||
71 | + int ret; | ||
72 | + | ||
73 | + ret = gnutls_record_recv(ssl->gnutls_state, ssl->ssl_peek_buffer, len); | ||
74 | + ssl->last_error = ret; | ||
75 | + | ||
76 | + if (ret > 0) | ||
77 | + ssl->ssl_peek_avail += ret; | ||
78 | + } | ||
79 | + | ||
80 | + if (len > ssl->ssl_peek_avail) | ||
81 | + len = ssl->ssl_peek_avail; | ||
82 | + | ||
83 | + memcpy (buf, ssl->ssl_peek_buffer, len); | ||
84 | + | ||
85 | + return len; | ||
86 | +} | ||
87 | + | ||
88 | int | ||
89 | SSL_read (SSL * ssl, void *buf, int len) | ||
90 | { | ||
91 | int ret; | ||
92 | |||
93 | + if (ssl->ssl_peek_avail) { | ||
94 | + int n = (ssl->ssl_peek_avail > len) ? len : ssl->ssl_peek_avail; | ||
95 | + | ||
96 | + memcpy (buf, ssl->ssl_peek_buffer, n); | ||
97 | + | ||
98 | + if (ssl->ssl_peek_avail > n) | ||
99 | + memmove (ssl->ssl_peek_buffer, ssl->ssl_peek_buffer + n, ssl->ssl_peek_avail - n); | ||
100 | + | ||
101 | + ssl->ssl_peek_avail -= n; | ||
102 | + | ||
103 | + return n; | ||
104 | + } | ||
105 | + | ||
106 | ret = gnutls_record_recv (ssl->gnutls_state, buf, len); | ||
107 | ssl->last_error = ret; | ||
108 | |||
109 | Index: gnutls-1.6.0/includes/gnutls/openssl.h | ||
110 | =================================================================== | ||
111 | --- gnutls-1.6.0.orig/includes/gnutls/openssl.h 2006-03-08 11:44:58.000000000 +0100 | ||
112 | +++ gnutls-1.6.0/includes/gnutls/openssl.h 2006-12-12 15:07:26.032227000 +0100 | ||
113 | @@ -164,6 +164,11 @@ | ||
114 | |||
115 | gnutls_transport_ptr_t rfd; | ||
116 | gnutls_transport_ptr_t wfd; | ||
117 | + | ||
118 | + char *ssl_peek_buffer; | ||
119 | + size_t ssl_peek_buffer_size; | ||
120 | + size_t ssl_peek_avail; | ||
121 | + | ||
122 | }; | ||
123 | |||
124 | #define rbio gnutls_state | ||
diff --git a/meta/packages/gnutls/gnutls-2.4.2/gnutls-texinfo-euro.patch b/meta/packages/gnutls/gnutls-2.4.2/gnutls-texinfo-euro.patch new file mode 100644 index 0000000000..e2a2762424 --- /dev/null +++ b/meta/packages/gnutls/gnutls-2.4.2/gnutls-texinfo-euro.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | The version of texinfo in Debian Sarge does not understand the @euro{} command. | ||
2 | This patch replaces the @euro{} command with the word "euro". | ||
3 | |||
4 | --- gnutls-1.3.5/doc/signatures.texi.orig 2006-04-26 08:06:40.918268000 +0930 | ||
5 | +++ gnutls-1.3.5/doc/signatures.texi 2006-04-26 08:06:52.446515440 +0930 | ||
6 | @@ -11,8 +11,8 @@ | ||
7 | long as it is difficult enough to generate two different messages with | ||
8 | the same hash algorithm output. In that case the same signature could | ||
9 | be used as a proof for both messages. Nobody wants to sign an innocent | ||
10 | -message of donating 1 @euro{} to Greenpeace and find out that he | ||
11 | -donated 1.000.000 @euro{} to Bad Inc. | ||
12 | +message of donating 1 euro to Greenpeace and find out that he | ||
13 | +donated 1.000.000 euro to Bad Inc. | ||
14 | |||
15 | For a hash algorithm to be called cryptographic the following three | ||
16 | requirements must hold | ||
diff --git a/meta/packages/gnutls/gnutls_2.4.2.bb b/meta/packages/gnutls/gnutls_2.4.2.bb new file mode 100644 index 0000000000..3313a456a1 --- /dev/null +++ b/meta/packages/gnutls/gnutls_2.4.2.bb | |||
@@ -0,0 +1,7 @@ | |||
1 | require gnutls.inc | ||
2 | |||
3 | SRC_URI += "\ | ||
4 | file://gnutls-openssl.patch;patch=1 \ | ||
5 | file://gnutls-texinfo-euro.patch;patch=1 \ | ||
6 | file://configure_madness.patch;patch=1 \ | ||
7 | " | ||