Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Jan 2013 08:56:50 -0600
From:      Michael Stowe <mstowe@chicago.us.mensa.org>
To:        john@pcbsd.org
Cc:        ports@FreeBSD.org
Subject:   FreeBSD Port: pianobar-2012.09.07
Message-ID:  <50E44AB2.9060006@chicago.us.mensa.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------020408010309080609060903
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

This port was not working for me, and after doing some research, 
determined that Pandora is triggering a GNUTLS_UNEXPECTED_PACKET_LENGTH 
error in gnutls during handshaking. I've attached a patch which corrects 
this issue.

There's a discussion here 
https://github.com/PromyLOPh/pianobar/issues/321 (though I'll point out 
that it confuses a second issue, which is that the tls_fingerprint 
changed, which also causes a TLS handshake error but it unrelated.)

And there's a patch here:  https://gist.github.com/4051586 which is 
slightly different, but is the "quick and dirty" fix that apparently is 
NOT going into upstream.  I'm not sure what the upstream fix will be, 
but there isn't one yet.

I can put together a PR if that would be helpful.

Thanks!

--------------020408010309080609060903
Content-Type: text/plain; charset=windows-1252;
 name="pianobar.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="pianobar.patch"

diff -ruN pianobar/work/pianobar-2012.12.01/src/libwaitress/waitress.c pianobar.fix/work/pianobar-2012.12.01/src/libwaitress/waitress.c
--- pianobar/work/pianobar-2012.12.01/src/libwaitress/waitress.c	2012-12-01 11:03:23.000000000 -0600
+++ pianobar.fix/work/pianobar-2012.12.01/src/libwaitress/waitress.c	2013-01-02 08:44:41.000000000 -0600
@@ -537,6 +537,14 @@
 
 	ssize_t ret = gnutls_record_recv (waith->request.tlsSession, buf, size);
 	if (ret < 0) {
+		if (ret == GNUTLS_E_UNEXPECTED_PACKET_LENGTH
+#ifdef GNUTLS_E_PREMATURE_TERMINATION
+					   || ret == GNUTLS_E_PREMATURE_TERMINATION
+#endif
+					) {
+			*retSize = 0;
+			return waith->request.readWriteRet;
+		}
 		return WAITRESS_RET_TLS_READ_ERR;
 	} else {
 		*retSize = ret;

--------------020408010309080609060903--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50E44AB2.9060006>