From b9f088915ec922518eca75ba767f2a84d06ced31 Mon Sep 17 00:00:00 2001 From: Jack Magne Date: Wed, 23 Apr 2014 16:17:11 -0700 Subject: [PATCH] Fix for #1090680, Http client doesn't provide standard intro string to server. --- esc-1.1.0-fix19.patch | 79 +++++++++++++++++++++++++++++++++++++++++++ esc.spec | 6 +++- 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 esc-1.1.0-fix19.patch diff --git a/esc-1.1.0-fix19.patch b/esc-1.1.0-fix19.patch new file mode 100644 index 0000000..acf7010 --- /dev/null +++ b/esc-1.1.0-fix19.patch @@ -0,0 +1,79 @@ +diff -up ./esc/src/app/xul/esc/application.ini.fix19 ./esc/src/app/xul/esc/application.ini +--- ./esc/src/app/xul/esc/application.ini.fix19 2014-04-23 14:42:02.644058331 -0700 ++++ ./esc/src/app/xul/esc/application.ini 2014-04-23 14:42:22.990803962 -0700 +@@ -25,11 +25,11 @@ Vendor=RedHat + Name=ESC + ; + ; This field specifies your application's version. This field is optional. +-Version=1.1.0-23 ++Version=1.1.0-24 + ; + ; This field specifies your application's build ID (timestamp). This field is + ; required. +-BuildID=0000001023 ++BuildID=0000001024 + ; + ; This ID is just an example. Every XUL app ought to have it's own unique ID. + ; You can use the microsoft "guidgen" or "uuidgen" tools, or go on +diff -up ./esc/src/lib/NssHttpClient/Util.cpp.fix19 ./esc/src/lib/NssHttpClient/Util.cpp +--- ./esc/src/lib/NssHttpClient/Util.cpp.fix19 2014-04-23 14:40:14.001416551 -0700 ++++ ./esc/src/lib/NssHttpClient/Util.cpp 2014-04-23 14:41:19.864593148 -0700 +@@ -49,3 +49,26 @@ NSAPI_PUBLIC int Util::ascii2numeric (ch + } + return num; + } ++ ++// Remove stray trailing CRLF chars, replace with provided char. ++NSAPI_PUBLIC void Util::stripTrailingCRLF(char *buff, char replaceWith) ++{ ++ if(buff == NULL) ++ return; ++ ++ if(replaceWith == 0) ++ return; ++ ++ int buffLen = strlen(buff); ++ ++ if(buffLen == 0) ++ return; ++ ++ int buffLenMinusOne = buffLen - 1; ++ ++ for(int i = buffLenMinusOne; i >= 0; i--) { ++ if(buff[i] == 0x0d || buff[i] == 0x0a) { ++ buff[i] = replaceWith; ++ } ++ } ++} +diff -up ./esc/src/lib/NssHttpClient/Util.h.fix19 ./esc/src/lib/NssHttpClient/Util.h +--- ./esc/src/lib/NssHttpClient/Util.h.fix19 2014-04-23 14:40:20.020341304 -0700 ++++ ./esc/src/lib/NssHttpClient/Util.h 2014-04-23 14:41:30.120464932 -0700 +@@ -34,6 +34,7 @@ class Util + ~Util(); + public: + NSAPI_PUBLIC static int ascii2numeric(char ch); ++ NSAPI_PUBLIC static void stripTrailingCRLF(char *buff, char replaceWith); + /* static char *Buffer2String (Buffer &data); + static Buffer *Str2Buf (const char *s); + static char *URLEncode (Buffer &data); +diff -up ./esc/src/lib/NssHttpClient/request.cpp.fix19 ./esc/src/lib/NssHttpClient/request.cpp +--- ./esc/src/lib/NssHttpClient/request.cpp.fix19 2014-04-23 14:40:27.207251455 -0700 ++++ ./esc/src/lib/NssHttpClient/request.cpp 2014-04-23 14:41:38.935354731 -0700 +@@ -25,6 +25,7 @@ + #include "engine.h" + #include + #include ++#include "Util.h" + PRLogModuleInfo *httpLog = PR_NewLogModule("coolKeyHttpReq"); + + /** +@@ -283,6 +284,9 @@ PRBool PSHttpRequest::send( PRFileDesc * + if (strlen(_proxy_uri)) + path = _proxy_uri; + ++ //check for and replace stray line feed chars in path only. ++ Util::stripTrailingCRLF(path,' '); ++ + data = PR_smprintf( "%s %s %s\r\n", _method, path, + HttpProtocolToString(_proto) ); + diff --git a/esc.spec b/esc.spec index e30449d..f7d2aff 100644 --- a/esc.spec +++ b/esc.spec @@ -1,6 +1,6 @@ Name: esc Version: 1.1.0 -Release: 23%{?dist} +Release: 24%{?dist} Summary: Enterprise Security Client Smart Card Client License: GPL+ URL: http://directory.fedora.redhat.com/wiki/CoolKey @@ -34,6 +34,7 @@ Patch15: esc-1.1.0-fix15.patch Patch16: esc-1.1.0-fix16.patch Patch17: esc-1.1.0-fix17.patch Patch18: esc-1.1.0-fix18.patch +Patch19: esc-1.1.0-fix19.patch BuildRequires: doxygen fontconfig-devel freetype-devel >= 2.1 BuildRequires: glib2-devel libIDL-devel atk-devel gtk2-devel libjpeg-devel @@ -106,6 +107,7 @@ cryptographic smartcards. %patch16 -p1 -b .fix16 %patch17 -p1 -b .fix17 %patch18 -p1 -b .fix18 +%patch19 -p1 -b .fix19 r=$(uname -r | sed -e 's/\(^[^.]*\.[^.]*\).*/\1/') [ -f esc/coreconf/Linux$r.mk ] || ln -s Linux3.5.mk esc/coreconf/Linux$r.mk @@ -234,6 +236,8 @@ if [ -x %{_bindir}/gtk-update-icon-cache ]; then fi %changelog +* Mon Apr 23 2014 Jack Magne =1.1.0-24 +- Fix minor http client error. * Thu Apr 17 2014 Jack Maghe =1.1.0-23 - Appease more xulrunner changes. * Sat Aug 03 2013 Fedora Release Engineering - 1.1.0-23