FreeBSD Port: pianobar-2012.09.07

Michael Stowe mstowe at chicago.us.mensa.org
Wed Jan 2 15:25:13 UTC 2013


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!
-------------- next part --------------
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;


More information about the freebsd-ports mailing list