Hello community, here is the log from the commit of package libisds for openSUSE:Factory checked in at 2016-04-12 19:39:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libisds (Old) and /work/SRC/openSUSE:Factory/.libisds.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libisds" Changes: -------- --- /work/SRC/openSUSE:Factory/libisds/libisds.changes 2015-09-08 18:04:42.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libisds.new/libisds.changes 2016-04-12 19:39:53.000000000 +0200 @@ -1,0 +2,20 @@ +Mon Apr 11 18:09:19 UTC 2016 - [email protected] + +- Add gpg signature +- Small cleanup with spec-cleaner + * use valid rpm category + * use pkgconfig() style dependencies +-Update build dependencies + * add gpgme-devel + +------------------------------------------------------------------- +Mon Apr 11 15:32:40 UTC 2016 - [email protected] + +- Version bump to 0.10.3: + * l10n: Update translation catalogues + * Correct _isds_build_url_from_context() documentation + * Do not use dolar in formatting strings + * Fixed a potential bug when printing debugging information. + * Fix building without libcurl + +------------------------------------------------------------------- Old: ---- libisds-0.10.1.tar.xz New: ---- libisds-0.10.3.tar.xz libisds-0.10.3.tar.xz.asc libisds.keyring ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libisds.spec ++++++ --- /var/tmp/diff_new_pack.XAjHnU/_old 2016-04-12 19:39:54.000000000 +0200 +++ /var/tmp/diff_new_pack.XAjHnU/_new 2016-04-12 19:39:54.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package libisds # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,15 +18,18 @@ %define libname %{name}5 Name: libisds -Version: 0.10.1 +Version: 0.10.3 Release: 0 Summary: Library for accessing the Czech Data Boxes License: LGPL-3.0+ Group: System/Libraries Url: http://xpisar.wz.cz/libisds/ Source0: http://xpisar.wz.cz/%{name}/dist/%{name}-%{version}.tar.xz +Source1: http://xpisar.wz.cz/%{name}/dist/%{name}-%{version}.tar.xz.asc +Source2: %{name}.keyring BuildRequires: gpg2 BuildRequires: libgcrypt-devel +BuildRequires: libgpgme-devel BuildRequires: pkg-config BuildRequires: pkgconfig(expat) >= 2.0.0 BuildRequires: pkgconfig(gnutls) >= 2.12.0 @@ -52,9 +55,8 @@ %package devel Summary: Development files for %{name} -Group: Development/Libraries +Group: Development/Languages/C and C++ Requires: %{libname} = %{version} -Requires: pkg-config %description devel The %{name}-devel package contains libraries and header files for @@ -75,14 +77,13 @@ make check %{?_smp_mflags} %install -make DESTDIR=%{buildroot} install %{?_smp_mflags} +make %{?_smp_mflags} DESTDIR=%{buildroot} install find %{buildroot} -type f -name "*.la" -delete -print %find_lang %{name} mv doc specification rm -rf client/.deps %post -n %{libname} -p /sbin/ldconfig - %postun -n %{libname} -p /sbin/ldconfig %files -n %{libname} -f %{name}.lang ++++++ libisds-0.10.1.tar.xz -> libisds-0.10.3.tar.xz ++++++ ++++ 2211 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libisds-0.10.1/ChangeLog new/libisds-0.10.3/ChangeLog --- old/libisds-0.10.1/ChangeLog 2015-09-06 10:17:12.000000000 +0200 +++ new/libisds-0.10.3/ChangeLog 2016-03-18 19:48:21.000000000 +0100 @@ -1,4 +1,97 @@ -commit f41a9ae065cb9764a8b12fe56a97d03b393e0d1a (HEAD -> refs/heads/v0.10-stable) +commit bf9cd27c03dd0dddd882efd5daf7708bb0ee1f01 (HEAD -> refs/heads/v0.10-stable) +Author: Petr Písař <[email protected]> +Date: Fri Mar 18 19:47:45 2016 +0100 + + l10n: Update translation catalogues + +commit 3056a30d795721e6c5bb7f73e6adfc305bbff2fe +Author: Petr Písař <[email protected]> +Date: Fri Mar 18 18:28:47 2016 +0100 + + Increase version to 0.10.3 + +commit 5875136cc24682f1acdff6552e9b53996858cc09 +Author: Petr Písař <[email protected]> +Date: Fri Mar 18 17:45:15 2016 +0100 + + Correct _isds_build_url_from_context() documentation + + This copies changes in _isds_build_url_from_context() documentstion from + soap.c to soap.h as made in: + + commit 1d1041f77de2fb21629e8e8d70ee872189f2654b + Author: Petr Písař <[email protected]> + Date: Wed Mar 16 21:13:59 2016 +0100 + + Do not use dolar in formatting strings + +commit 8610a389f5e5ba1fb6c3d3c2d3ff2323724e3618 +Author: Petr Písař <[email protected]> +Date: Wed Mar 16 21:13:59 2016 +0100 + + Do not use dolar in formatting strings + + ISO C 99 does not support "$" to control print(3) arguments order. This is not + support on mingw platform. + + This patch changes the library code in order not to use it. It sucks because + it makes the code less elegant and less readable. + + The same problem can occur in translated messages. I worry translations + without capability of words reordering will be dumb. I urge people to use + better toolchains. + +commit e4df4393111f3fc1c2353c39b93035708e21fd8c +Author: Karel Slany <[email protected]> +Date: Sun Mar 6 11:12:01 2016 +0100 + + Fixed a potential bug when printing debugging information. + + According to C standard, the string precision/length limit argument of printf() + when using "%.*s" must have int type. Using size_t instead can cause wrong + interpretation of data stored on stack. Depending on the compiler and system + this may result in random programme crashes. It is better to stick to + the standard and pass int as string length. + +commit cfc630a7ffe1b4c2fa4df455e5317f237e451480 +Author: Petr Písař <[email protected]> +Date: Fri Feb 5 21:16:44 2016 +0100 + + test: Fix indentation + + This caused a warnings with GCC 6: + + http.c: In function 'base64_encode_blockend': + http.c:138:2: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation] + return codechar - code_out; + ^~~~~~ + http.c:135:5: note: ...this 'if' clause, but it is not + if (state_in->stepcount >= 0) + ^~ + +commit 6340b771dcb8a22775086f6fccf69d40094b09c5 (refs/remotes/repo.or.cz/v0.10-stable) +Author: Petr Písař <[email protected]> +Date: Thu Jan 14 20:46:57 2016 +0100 + + Increase version to 0.10.2 + +commit 3d5b2d8d2714b10e995886a158bd8bdb406efe11 +Author: Petr Písař <[email protected]> +Date: Thu Jan 14 20:16:39 2016 +0100 + + Fix building without libcurl + + If configured --without-libcurl, compilation failed with: + + isds.c:11090:17: error: 'struct isds_ctx' has no member named 'curl' + + This was caused by misplaced condition on libcurl support. This patch fixes it + together with similar mistake in offline tests. + + Reported by Toralf Förster from Gentoo tinderbox testing + <https://bugs.gentoo.org/show_bug.cgi?id=571906>. + +commit f41a9ae065cb9764a8b12fe56a97d03b393e0d1a (tag: refs/tags/v0.10.1) Author: Petr Písař <[email protected]> Date: Sun Sep 6 10:03:16 2015 +0200 @@ -527,7 +620,7 @@ Function _isds_compute_hash() is implemented using OpenSSL. -commit a75256a761e0b29b2ec4b8b7bff2c19890410dc6 (refs/remotes/cznic/master) +commit a75256a761e0b29b2ec4b8b7bff2c19890410dc6 Author: Petr Písař <[email protected]> Date: Fri Sep 26 12:26:02 2014 +0200 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libisds-0.10.1/NEWS new/libisds-0.10.3/NEWS --- old/libisds-0.10.1/NEWS 2015-09-06 10:07:25.000000000 +0200 +++ new/libisds-0.10.3/NEWS 2016-03-18 18:28:27.000000000 +0100 @@ -1,7 +1,30 @@ +Version 0.10.3 +============== + +• This release is fully compatible with the previous one. + +• Dollar characters controlling argument orderding were removed from +printf-like formatting strings. They are not supported in mingw toolchain and +caused one-time password authentication failures on Windows platform. + +• Logging binary blobs on debug level could read unitialized memory on +platforms where size_t type is not compatible with int type. This is fixed +now. + +• An indentation warning reported by GCC 6 was fixed. + +Version 0.10.2 +============== + +• This release is fully compatible with previous one. There are only minimal +changes allowing to build without libcurl. + +• Compilation failed if libcurl support was disabled. This is fixed now. + Version 0.10.1 ============== -• This release is fully compatible with previous one. There are no chaneges in +• This release is fully compatible with previous one. There are no changes in the code. Only tests were updated. • Pregenerated certificates used for tests expired causing a test unit to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libisds-0.10.1/configure.ac new/libisds-0.10.3/configure.ac --- old/libisds-0.10.1/configure.ac 2015-09-06 10:07:25.000000000 +0200 +++ new/libisds-0.10.3/configure.ac 2016-03-18 18:15:23.000000000 +0100 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) -AC_INIT([libisds], [0.10.1], [[email protected]]) +AC_INIT([libisds], [0.10.3], [[email protected]]) AM_INIT_AUTOMAKE AC_LANG([C]) AC_CONFIG_SRCDIR([src/isds.c]) Files old/libisds-0.10.1/po/cs.gmo and new/libisds-0.10.3/po/cs.gmo differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libisds-0.10.1/po/cs.po new/libisds-0.10.3/po/cs.po --- old/libisds-0.10.1/po/cs.po 2015-09-06 10:12:10.000000000 +0200 +++ new/libisds-0.10.3/po/cs.po 2016-03-18 18:35:58.000000000 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: libisds 0.10\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2015-09-06 10:12+0200\n" +"POT-Creation-Date: 2016-03-18 18:35+0100\n" "PO-Revision-Date: 2015-01-10 16:49+0100\n" "Last-Translator: Petr Pisar <[email protected]>\n" "Language-Team: Czech <[email protected]>\n" @@ -415,8 +415,8 @@ #: src/isds.c:6739 src/isds.c:6864 src/isds.c:6966 src/isds.c:7107 #: src/isds.c:7215 src/isds.c:7673 src/isds.c:7886 src/isds.c:8156 #: src/isds.c:8415 src/isds.c:8503 src/isds.c:8742 src/isds.c:8958 -#: src/isds.c:9211 src/isds.c:9532 src/isds.c:9695 src/isds.c:11102 -#: src/isds.c:11609 src/isds.c:11754 +#: src/isds.c:9211 src/isds.c:9532 src/isds.c:9695 src/isds.c:11106 +#: src/isds.c:11613 src/isds.c:11758 msgid "Could not create ISDS name space" msgstr "Nebylo možné vytvořit jmenný prostor ISDS" @@ -491,7 +491,7 @@ msgid "Could not create xmlBuffer" msgstr "Nebylo možné vytvořit xmlBuffer" -#: src/isds.c:1761 src/isds.c:1914 src/soap.c:1197 +#: src/isds.c:1761 src/isds.c:1914 src/soap.c:1203 msgid "Could not create XML serializer" msgstr "Nebylo možné vytvořit serializátor XML" @@ -608,7 +608,7 @@ msgid "Invalid dbType value: %d" msgstr "Neplatná hodnota dbType: %d" -#: src/isds.c:3255 src/isds.c:10933 +#: src/isds.c:3255 src/isds.c:10937 #, c-format msgid "Unknown isds:userType value: %s" msgstr "Neznámá hodnota isds:userType: %s" @@ -1073,7 +1073,7 @@ msgid "Could not create ISDS1 name space" msgstr "Nebylo možné vytvořit jmenný prostor ISDS1" -#: src/isds.c:6220 src/isds.c:11558 +#: src/isds.c:6220 src/isds.c:11562 msgid "CreateDataBox request processed by server successfully.\n" msgstr "Požadavek CreateDataBox úspěšně zpracován serverem.\n" @@ -1524,7 +1524,7 @@ #, c-format msgid "Server did not return any signed data for message ID `%s' on %s request" msgstr "" -"Server nevrátil na požadavek %2$s žádná podepsaná data pro zprávu s ID „%1$s“" +"Server nevrátil žádná podepsaná data pro zprávu s ID „%s“ na požadavek %s" #: src/isds.c:9822 #, c-format @@ -1563,7 +1563,7 @@ msgid "Bad raw delivery representation type" msgstr "Chybný typ surové reprezentace doručenky" -#: src/isds.c:10037 +#: src/isds.c:10038 #, c-format msgid "" "Delivery info content:\n" @@ -1574,23 +1574,23 @@ "%.*s\n" "Konec informace o doručení\n" -#: src/isds.c:10080 +#: src/isds.c:10082 msgid "XML document is not sisds:dmDelivery document" msgstr "Dokument XML není dokumentem sisds:dmDelivery" -#: src/isds.c:10087 +#: src/isds.c:10089 msgid "XML document has more sisds:dmDelivery elements" msgstr "Dokument XML obsahuje více elementů sisds:dmDelivery" -#: src/isds.c:10146 +#: src/isds.c:10148 msgid "Delivery info loaded successfully.\n" msgstr "Informace o doručení úspěšně nahrány.\n" -#: src/isds.c:10211 +#: src/isds.c:10213 msgid "GetSignedDeliveryInfo request processed by server successfully.\n" msgstr "Požadavek GetSignedDeliveryInfo úspěšně zpracován serverem.\n" -#: src/isds.c:10261 +#: src/isds.c:10263 #, c-format msgid "" "Server did not return any delivery info for ID `%s' on GetDeliveryInfo " @@ -1599,22 +1599,22 @@ "Server na požadavek GetDeliveryInfo s ID „%s“ nevrátil žádné informace " "o doručení" -#: src/isds.c:10293 +#: src/isds.c:10295 msgid "GetDeliveryInfo request processed by server successfully.\n" msgstr "Požadavek GetDeliveryInfo úspěšně zpracován serverem.\n" -#: src/isds.c:10359 +#: src/isds.c:10361 #, c-format msgid "" "Server did not return any message for ID `%s' on MessageDownload request" msgstr "Server na požadavek MessageDownload s ID „%s“ nevrátil žádnou zprávu" -#: src/isds.c:10369 +#: src/isds.c:10371 #, c-format msgid "Server did return more messages for ID `%s' on MessageDownload request" msgstr "Server na požadavek MessageDownload s ID „%s“ vrátil více zpráv" -#: src/isds.c:10399 +#: src/isds.c:10401 msgid "" "Substring with isds:MessageDownloadResponse element could not be located in " "raw SOAP message" @@ -1622,15 +1622,15 @@ "Podřetězec s elementem isds:MessageDownloadResponse nemohl být nalezen " "v syrové SOAP zprávě" -#: src/isds.c:10437 +#: src/isds.c:10439 msgid "MessageDownload request processed by server successfully.\n" msgstr "Požadavek MessageDownload úspěšně zpracován serverem.\n" -#: src/isds.c:10511 +#: src/isds.c:10513 msgid "Bad raw message representation type" msgstr "Chybný typ reprezentace syrové zprávy" -#: src/isds.c:10517 +#: src/isds.c:10520 #, c-format msgid "" "Loading message:\n" @@ -1641,98 +1641,98 @@ "%.*s\n" "Konec zprávy\n" -#: src/isds.c:10581 +#: src/isds.c:10585 msgid "XML document does not contain sisds:dmReturnedMessage element" msgstr "Dokument XML neobsahuje element sisds:dmReturnedMessage" -#: src/isds.c:10589 +#: src/isds.c:10593 msgid "XML document has more sisds:dmReturnedMessage elements" msgstr "Dokument XML obsahuje více elementů sisds:dmReturnedMessage" -#: src/isds.c:10638 +#: src/isds.c:10642 msgid "Message loaded successfully.\n" msgstr "Zpráva úspěšně nahrána.\n" -#: src/isds.c:10677 +#: src/isds.c:10681 msgid "Could not parse data as XML document" msgstr "Data nebylo možné rozebrat coby XML dokument" -#: src/isds.c:10686 +#: src/isds.c:10690 msgid "XML document is missing root element" msgstr "Dokument XML postrádá kořenový element" -#: src/isds.c:10693 +#: src/isds.c:10697 msgid "Root element does not belong to any name space" msgstr "Kořenový element nespadá do žádného jmenného prostoru" -#: src/isds.c:10717 +#: src/isds.c:10721 msgid "Document in ISDS name space is encapsulated into CMS" msgstr "Dokument ze jmenného prostoru ISDS je zabalen do CMS" -#: src/isds.c:10725 +#: src/isds.c:10729 msgid "Unknown root element in ISDS name space" msgstr "Neznámý kořenový element ve jmenném prostoru ISDS" -#: src/isds.c:10730 +#: src/isds.c:10734 msgid "Unknown name space" msgstr "Neznámý jmenný prostor" -#: src/isds.c:10811 +#: src/isds.c:10815 msgid "SignedSentMessageDownload request processed by server successfully.\n" msgstr "Požadavek SignedSentMessageDownload úspěšně zpracován serverem.\n" -#: src/isds.c:10813 +#: src/isds.c:10817 msgid "SignedMessageDownload request processed by server successfully.\n" msgstr "Požadavek SignedMessageDownload úspěšně zpracován serverem.\n" -#: src/isds.c:10902 +#: src/isds.c:10906 msgid "Missing GetMessageAuthorResponse element" msgstr "Chybí element GetMessageAuthorResponse" -#: src/isds.c:10908 +#: src/isds.c:10912 msgid "Multiple GetMessageAuthorResponse element" msgstr "Násobný element GetMessageAuthorResponse" -#: src/isds.c:10960 +#: src/isds.c:10964 msgid "GetMessageAuthor request processed by server successfully.\n" msgstr "Požadavek GetMessageAuthor úspěšně zpracován serverem.\n" -#: src/isds.c:11018 +#: src/isds.c:11022 #, c-format msgid "Server did not return any response for ID `%s' on VerifyMessage request" msgstr "Server na požadavek VerifyMessage s ID „%s“ nevrátil žádnou odpověď" -#: src/isds.c:11028 +#: src/isds.c:11032 #, c-format msgid "Server did return more responses for ID `%s' on VerifyMessage request" msgstr "Server na požadavek VerifyMessage s ID „%s“ vrátil více odpovědí" -#: src/isds.c:11054 +#: src/isds.c:11058 msgid "VerifyMessage request processed by server successfully.\n" msgstr "Požadavek VerifyMessage úspěšně zpracován serverem.\n" -#: src/isds.c:11097 +#: src/isds.c:11101 msgid "Could build EraseMessage request" msgstr "Požadavek EraseMessage nebylo možné sestavit" -#: src/isds.c:11116 +#: src/isds.c:11120 #, c-format msgid "Sending EraseMessage request for message ID %s to ISDS\n" msgstr "Odesílá se požadavek EraseMessage na zprávu s ID %s do ISDS\n" -#: src/isds.c:11123 +#: src/isds.c:11127 msgid "Processing ISDS response on EraseMessage request failed\n" msgstr "Zpracování odpovědi ISDS na požadavek EraseMessage selhalo\n" -#: src/isds.c:11133 +#: src/isds.c:11137 msgid "ISDS response on EraseMessage request is missing status\n" msgstr "Odpověď ISDS na požadavek EraseMessage postrádá status\n" -#: src/isds.c:11140 +#: src/isds.c:11144 msgid "Message to erase belongs to other box" msgstr "Zpráva určená ke smazání náleží jiné schránce" -#: src/isds.c:11143 +#: src/isds.c:11147 msgid "" "Message to erase is not saved in long term storage or the direction does not " "match" @@ -1740,52 +1740,52 @@ "Zpráva určená ke smazání není uložena v dlouhodobém úložišti nebo směr " "zprávy neodpovídá" -#: src/isds.c:11150 +#: src/isds.c:11154 #, c-format msgid "Server refused EraseMessage request (code=%s, message=%s)\n" msgstr "Server odmítl požadavek EraseMessage (kód=%s, zpráva=%s)\n" -#: src/isds.c:11168 +#: src/isds.c:11172 msgid "EraseMessage request processed by server successfully.\n" msgstr "Požadavek EraseMessage úspěšně zpracován serverem.\n" -#: src/isds.c:11206 +#: src/isds.c:11210 msgid "MarkMessageAsDownloaded request processed by server successfully.\n" msgstr "Požadavek MarkMessageAsDownloaded úspěšně zpracován serverem.\n" -#: src/isds.c:11246 +#: src/isds.c:11250 msgid "ConfirmDelivery request processed by server successfully.\n" msgstr "Požadavek ConfirmDelivery úspěšně zpracován serverem.\n" -#: src/isds.c:11292 +#: src/isds.c:11296 msgid "XML documents cannot be submitted to conversion" msgstr "Dokumenty XML nelze odeslat ke konverzi" -#: src/isds.c:11319 +#: src/isds.c:11323 msgid "Could not build Czech POINT conversion request" msgstr "Požadavek na konverzi Czech POINTem nebylo možné sestavit" -#: src/isds.c:11325 +#: src/isds.c:11329 msgid "Could not create Czech POINT deposit name space" msgstr "Nebylo možné vytvořit jmenný prostor úschovny Czech POINTu" -#: src/isds.c:11334 +#: src/isds.c:11338 msgid "Could not create empty name space" msgstr "Nebylo možné vytvořit prázdný jmenný prostor" -#: src/isds.c:11348 +#: src/isds.c:11352 msgid "Submitting document for conversion into Czech POINT deposit" msgstr "Odesílá se dokument na konverzi do úschovny Czech POINTu" -#: src/isds.c:11380 +#: src/isds.c:11384 msgid "Missing `return' element in Czech POINT deposit response" msgstr "V odpovědi úschovny Czech POINTu chybí element „return“" -#: src/isds.c:11387 +#: src/isds.c:11391 msgid "Multiple `return' element in Czech POINT deposit response" msgstr "V odpovědi úschovny Czech POINTu je element „return“ vícekrát" -#: src/isds.c:11400 +#: src/isds.c:11404 #, c-format msgid "" "Czech POINT deposit refused document for conversion (code=%ld, message=%s)" @@ -1793,90 +1793,90 @@ "Úschovna Czech POINTu odmítla dokument určený pro konverzi (kód=%ld, zpráva=" "%s)" -#: src/isds.c:11425 +#: src/isds.c:11429 #, c-format msgid "Invalid dateInserted value: %s" msgstr "Neplatná hodnota dateInserted: %s" -#: src/isds.c:11443 +#: src/isds.c:11447 #, c-format msgid "Document %s has been submitted for conversion to server successfully\n" msgstr "Dokument %s byl úspěšně odeslán serveru za účelem konverze\n" -#: src/isds.c:11505 +#: src/isds.c:11509 msgid "E-mail field is mandatory" msgstr "Položka E-mail je povinná" -#: src/isds.c:11604 +#: src/isds.c:11608 msgid "Could not build AuthenticateMessage request" msgstr "Požadavek AuthenticateMessage nebylo možné sestavit" -#: src/isds.c:11642 +#: src/isds.c:11646 msgid "Server did not return any response on AuthenticateMessage request" msgstr "Server na požadavek AuthenticateMessage nevrátil žádnou odpověď" -#: src/isds.c:11649 +#: src/isds.c:11653 msgid "ISDS authenticated the message successfully\n" msgstr "ISDS potvrdil pravost zprávy\n" -#: src/isds.c:11651 +#: src/isds.c:11655 msgid "ISDS does not know the message" msgstr "ISDS takovou zprávu nezná" -#: src/isds.c:11730 +#: src/isds.c:11734 msgid "Empty CMS blob on input" msgstr "Na vstupu je prázdná struktura CMS" -#: src/isds.c:11735 +#: src/isds.c:11739 msgid "NULL pointer provided for output CMS blob" msgstr "Pro výstupní strukturu CMS byl předán ukazatel NULL" -#: src/isds.c:11749 +#: src/isds.c:11753 msgid "Could not build Re-signISDSDocument request" msgstr "Požadavek Re-signISDSDocument nebylo možné sestavit" -#: src/isds.c:11790 +#: src/isds.c:11794 msgid "Missing Re-signISDSDocumentResponse element" msgstr "Chybí element Re-signISDSDocumentResponse" -#: src/isds.c:11796 +#: src/isds.c:11800 msgid "Multiple Re-signISDSDocumentResponse element" msgstr "Násobný element Re-signISDSDocumentResponse" -#: src/isds.c:11809 +#: src/isds.c:11813 msgid "Error while Base64-decoding re-signed data" msgstr "Chyba při dekódování přepodepsaných dat z Base64" -#: src/isds.c:11814 +#: src/isds.c:11818 msgid "Server did not send re-signed data" msgstr "Server nezaslal přepodepsaná data" -#: src/isds.c:11835 +#: src/isds.c:11839 #, c-format msgid "Invalid dmValidTo value: %s" msgstr "Neplatná hodnota dmValidTo: %s" -#: src/isds.c:11897 +#: src/isds.c:11901 msgid "Message does not carry raw representation" msgstr "Zpráva nenese syrovou reprezentaci" -#: src/isds.c:11937 +#: src/isds.c:11941 msgid "Bad raw representation type" msgstr "Chybný typ syrové reprezentace" -#: src/isds.c:11960 +#: src/isds.c:11964 msgid "Substring with isds:dmDM element could not be located in raw message" msgstr "V syrové zprávě nebylo možné nalézt podřetězec s elementem isds:dmDM" -#: src/isds.c:11976 +#: src/isds.c:11980 msgid "Could not compute message hash" msgstr "Nebylo možné spočítat hash zprávy" -#: src/isds.c:12049 +#: src/isds.c:12053 msgid "Given message structure is missing envelope" msgstr "Zadaná struktura zprávy postrádá obálku" -#: src/isds.c:12054 +#: src/isds.c:12058 msgid "Given message structure is missing raw representation" msgstr "Zadaná struktura zprávy postrádá syrovou reprezentaci" @@ -2060,79 +2060,79 @@ msgid "POST body length: %zu, content follows:\n" msgstr "Délka těla POSTu: %zu, obsah následuje:\n" -#: src/soap.c:904 +#: src/soap.c:907 msgid "End of POST body\n" msgstr "Konec těla POSTu\n" -#: src/soap.c:921 +#: src/soap.c:924 #, c-format msgid "%s: %s" msgstr "%s: %s" -#: src/soap.c:944 +#: src/soap.c:947 #, c-format msgid "Final response to %s received\n" msgstr "Konečná odpověď na %s přijata\n" -#: src/soap.c:946 +#: src/soap.c:949 #, c-format msgid "Response body length: %zu, content follows:\n" msgstr "Délka těla odpovědi: %zu, obsah následuje:\n" -#: src/soap.c:949 +#: src/soap.c:955 msgid "End of response body\n" msgstr "Konec těla odpovědi\n" -#: src/soap.c:1002 +#: src/soap.c:1008 #, c-format msgid "OTP authentication headers received: method=%s, code=%s, message=%s\n" msgstr "" "Přijaty autentizační hlavičky jednorázového hesla: metoda=%s, heslo=%s, " "zpráva=%s\n" -#: src/soap.c:1022 +#: src/soap.c:1028 #, c-format msgid "Server returned OTP authentication message: %s" msgstr "Server vrátil zprávu o autentizaci jednorázovým heslem: %s" -#: src/soap.c:1036 +#: src/soap.c:1042 #, c-format msgid "OTP authentication headers redirect to: <%s>\n" msgstr "Hlavičky autentizace jednorázovým heslem přesměrovávají na: <%s>\n" -#: src/soap.c:1132 +#: src/soap.c:1138 msgid "Could not build SOAP request document" msgstr "Dokument se SOAP požadavkem nebylo možné sestavit" -#: src/soap.c:1138 +#: src/soap.c:1144 msgid "Could not build SOAP request envelope" msgstr "Obálku požadavku SOAP nebylo možné sestavit" -#: src/soap.c:1147 +#: src/soap.c:1153 msgid "Could not create SOAP name space" msgstr "Nebylo možné vytvořit jmenný prostor SOAP" -#: src/soap.c:1156 +#: src/soap.c:1162 msgid "Could not add Body to SOAP request envelope" msgstr "Do obálky požadavku SOAP nebylo možné vložit tělo" -#: src/soap.c:1168 +#: src/soap.c:1174 msgid "Could not copy request content" msgstr "Obsah požadavku nebylo možné zkopírovat" -#: src/soap.c:1175 +#: src/soap.c:1181 msgid "Could not add request content to SOAP request envelope" msgstr "Do obálky požadavku SOAP nebylo možné přidat obsah požadavku" -#: src/soap.c:1187 +#: src/soap.c:1193 msgid "Could not create xmlBuffer for HTTP request body" msgstr "Pro požadavek HTTP nebylo možné vytvořit xmlBuffer" -#: src/soap.c:1206 +#: src/soap.c:1212 msgid "Could not serialize SOAP request to HTTP request body" msgstr "Požadavek SOAP nebylo možné zapsat do těla požadavku HTTP" -#: src/soap.c:1217 +#: src/soap.c:1223 #, c-format msgid "" "SOAP request to sent to %s:\n" @@ -2143,22 +2143,22 @@ "%.*s\n" "Konec požadavku SOAP\n" -#: src/soap.c:1236 +#: src/soap.c:1242 #, c-format msgid "Server returned %ld HTTP code\n" msgstr "Server vrátil HTTP kód %ld\n" -#: src/soap.c:1258 +#: src/soap.c:1264 #, c-format msgid "Server redirects on <%s> because OTP authentication succeeded." msgstr "" "Server přesměrovává na <%s>, protože autentizace jednorázovým heslem uspěla." -#: src/soap.c:1272 +#: src/soap.c:1278 msgid "Could not remove credentials from CURL handle." msgstr "Autentizační údaje nebylo možné z deskriptoru CURL odstranit." -#: src/soap.c:1284 +#: src/soap.c:1290 #, c-format msgid "" "Code 302: Server redirects on <%s> request. Redirection is forbidden in " @@ -2167,21 +2167,21 @@ "Kód 302: Server přesměrovává při požadavku pro <%s>. V bezstavovém režimu je " "přesměrování zakázáno." -#: src/soap.c:1294 +#: src/soap.c:1300 msgid "Authentication failed" msgstr "Autentizace selhala" -#: src/soap.c:1300 +#: src/soap.c:1306 #, c-format msgid "Code 404: Document (%s) not found on server" msgstr "Kód 404: Dokument (%s) na serveru nenalezen" -#: src/soap.c:1314 +#: src/soap.c:1320 #, c-format msgid "%s: bad MIME type sent by server: %s" msgstr "%s: server zaslal chybný typ MIME: %s" -#: src/soap.c:1342 +#: src/soap.c:1349 #, c-format msgid "" "SOAP response received:\n" @@ -2192,28 +2192,28 @@ "%.*s\n" "Konec odpovědi SOAP\n" -#: src/soap.c:1370 +#: src/soap.c:1377 msgid "SOAP response requires unsupported feature" msgstr "Odpověď SOAP vyžaduje nepodporovanou funkci" -#: src/soap.c:1387 +#: src/soap.c:1394 msgid "SOAP response does not contain SOAP Body element" msgstr "Odpověď SOAP neobsahuje SOAP element Body" -#: src/soap.c:1393 +#: src/soap.c:1400 msgid "SOAP response has more than one Body element" msgstr "Odpověď SOAP obsahuje více jak jeden element Body" -#: src/soap.c:1439 +#: src/soap.c:1446 #, c-format msgid "SOAP response signals Fault: %s" msgstr "Odpověď SOAP signalizuje chybu (Fault): %s" -#: src/soap.c:1442 +#: src/soap.c:1449 msgid "SOAP response signals Fault" msgstr "Odpověď SOAP signalizuje chybu (Fault)" -#: src/soap.c:1516 +#: src/soap.c:1525 msgid "" "Base URL could not have been determined from context URL because there was " "no URL set in the context" @@ -2221,11 +2221,11 @@ "Z URL kontextu nebylo možné odvodit základní URL, protože kontext neměl " "nastaveno žádné URL" -#: src/soap.c:1526 +#: src/soap.c:1535 msgid "Base URL could not have been determined from context URL" msgstr "Z URL kontextu nebylo možné odvodit základní URL" -#: src/soap.c:1573 +#: src/soap.c:1583 #, c-format msgid "" "Cookie for OTP authenticated connection to <%s> could not been invalidated" @@ -2233,7 +2233,7 @@ "Cookie pro spojení k <%s> autentizované jednorázovým heslem nebylo možné " "zneplatnit" -#: src/soap.c:1577 +#: src/soap.c:1587 #, c-format msgid "Cookie for OTP authenticated connection to <%s> has been invalidated.\n" msgstr "" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libisds-0.10.1/src/isds.c new/libisds-0.10.3/src/isds.c --- old/libisds-0.10.1/src/isds.c 2015-01-10 21:06:24.000000000 +0100 +++ new/libisds-0.10.3/src/isds.c 2016-03-18 17:51:22.000000000 +0100 @@ -1356,7 +1356,7 @@ _("Selected authentication method: " "HMAC-based one-time password\n")); authenticator_uri = - "%1$sas/processLogin?type=hotp&uri=%1$sapps/"; + "%sas/processLogin?type=hotp&uri=%sapps/"; break; case OTP_TIME: isds_log(ILF_SEC, ILL_INFO, @@ -1368,16 +1368,16 @@ "application, requesting server for " "new one.\n")); authenticator_uri = - "%1$sas/processLogin?type=totp&sendSms=true&" - "uri=%1$sapps/"; + "%sas/processLogin?type=totp&sendSms=true&" + "uri=%sapps/"; } else { isds_log(ILF_SEC, ILL_INFO, _("OTP code has been provided by " "application, not requesting server " "for new one.\n")); authenticator_uri = - "%1$sas/processLogin?type=totp&" - "uri=%1$sapps/"; + "%sas/processLogin?type=totp&" + "uri=%sapps/"; } break; default: @@ -1386,7 +1386,7 @@ "method requested by application")); return IE_ENUM; } - if (-1 == isds_asprintf(&context->url, authenticator_uri, url)) + if (-1 == isds_asprintf(&context->url, authenticator_uri, url, url)) return IE_NOMEM; } } else { @@ -5330,7 +5330,7 @@ { char *new_url = NULL; if ((err = _isds_build_url_from_context(context, - "%1$.*2$sasws/changePassword", &new_url))) { + "%.*sasws/changePassword", &new_url))) { goto leave; } saved_url = context->url; @@ -5648,7 +5648,7 @@ { char *new_url = NULL; if ((err = _isds_build_url_from_context(context, - "%1$.*2$sasws/changePassword", &new_url))) { + "%.*sasws/changePassword", &new_url))) { goto leave; } saved_url = context->url; @@ -10033,9 +10033,11 @@ break; } - isds_log(ILF_ISDS, ILL_DEBUG, + if (_isds_sizet2int(xml_stream_length) >= 0) { + isds_log(ILF_ISDS, ILL_DEBUG, _("Delivery info content:\n%.*s\nEnd of delivery info\n"), - xml_stream_length, xml_stream); + _isds_sizet2int(xml_stream_length), xml_stream); + } /* Convert delivery info XML stream into XPath context */ message_doc = xmlParseMemory(xml_stream, xml_stream_length); @@ -10513,9 +10515,11 @@ break; } - isds_log(ILF_ISDS, ILL_DEBUG, - _("Loading message:\n%.*s\nEnd of message\n"), - xml_stream_length, xml_stream); + if (_isds_sizet2int(xml_stream_length) >= 0) { + isds_log(ILF_ISDS, ILL_DEBUG, + _("Loading message:\n%.*s\nEnd of message\n"), + _isds_sizet2int(xml_stream_length), xml_stream); + } /* Convert messages XML stream into XPath context */ message_doc = xmlParseMemory(xml_stream, xml_stream_length); @@ -11085,11 +11089,11 @@ zfree(context->long_message); if (NULL == message_id) return IE_INVAL; +#if HAVE_LIBCURL /* Check if connection is established * TODO: This check should be done downstairs. */ if (!context->curl) return IE_CONNECTION_CLOSED; -#if HAVE_LIBCURL /* Build request */ request = xmlNewNode(NULL, BAD_CAST "EraseMessage"); if (!request) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libisds-0.10.1/src/soap.c new/libisds-0.10.3/src/soap.c --- old/libisds-0.10.1/src/soap.c 2015-01-02 22:15:34.000000000 +0100 +++ new/libisds-0.10.3/src/soap.c 2016-03-18 17:51:22.000000000 +0100 @@ -900,7 +900,10 @@ if (!use_get) { isds_log(ILF_HTTP, ILL_DEBUG, _("POST body length: %zu, content follows:\n"), request_length); - isds_log(ILF_HTTP, ILL_DEBUG, "%.*s\n", request_length, request); + if (_isds_sizet2int(request_length) >= 0 ) { + isds_log(ILF_HTTP, ILL_DEBUG, "%.*s\n", + _isds_sizet2int(request_length), request); + } isds_log(ILF_HTTP, ILL_DEBUG, _("End of POST body\n")); } @@ -945,7 +948,10 @@ isds_log(ILF_HTTP, ILL_DEBUG, _("Response body length: %zu, content follows:\n"), body.length); - isds_log(ILF_HTTP, ILL_DEBUG, "%.*s\n", body.length, body.data); + if (_isds_sizet2int(body.length) >= 0) { + isds_log(ILF_HTTP, ILL_DEBUG, "%.*s\n", + _isds_sizet2int(body.length), body.data); + } isds_log(ILF_HTTP, ILL_DEBUG, _("End of response body\n")); @@ -1338,10 +1344,11 @@ goto leave; } - isds_log(ILF_SOAP, ILL_DEBUG, + if (_isds_sizet2int(response_length) >= 0) { + isds_log(ILF_SOAP, ILL_DEBUG, _("SOAP response received:\n%.*s\nEnd of SOAP response\n"), - response_length, http_response); - + _isds_sizet2int(response_length), http_response); + } /* Check for SOAP version */ response_root = xmlDocGetRootElement(response_soap_doc); @@ -1496,8 +1503,10 @@ /* Build new URL from current @context and template. * @context is context carrying an URL - * @template is printf(3) format string. First argument is string of base URL - * found in @context, second argument is length of the base URL. + * @template is printf(3) format string. First argument is length of the base + * URL found in @context, second argument is the base URL, third argument is + * again the base URL. + * XXX: We cannot use "$" formatting character because it's not in the ISO C99. * @new_url is newly allocated URL built from @template. Caller must free it. * Return IE_SUCCESS, or corresponding error code and @new_url will not be * allocated. @@ -1530,7 +1539,8 @@ length++; /* Build new URL */ - if (-1 == isds_asprintf(new_url, template, context->url, length)) + if (-1 == isds_asprintf(new_url, template, length, context->url, + context->url)) return IE_NOMEM; return IE_SUCCESS; @@ -1551,7 +1561,7 @@ /* Build logout URL */ /*"https://DOMAINNAME/as/processLogout?uri=https://DOMAINNAME/apps/DS/WEB_SERVICE_ENDPOINT"*/ err = _isds_build_url_from_context(context, - "%1$.*2$sas/processLogout?uri=%1$sDS/dz", &url); + "%.*sas/processLogout?uri=%sDS/dz", &url); if (err) return err; /* Invalidate the cookie by GET request */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libisds-0.10.1/src/soap.h new/libisds-0.10.3/src/soap.h --- old/libisds-0.10.1/src/soap.h 2014-12-14 17:31:22.000000000 +0100 +++ new/libisds-0.10.3/src/soap.h 2016-03-18 17:51:31.000000000 +0100 @@ -33,8 +33,10 @@ /* Build new URL from current @context and template. * @context is context carrying an URL - * @template is printf(3) format string. First argument is string of base URL - * found in @context, second argument is length of the base URL. + * @template is printf(3) format string. First argument is length of the base + * URL found in @context, second argument is the base URL, third argument is + * again the base URL. + * XXX: We cannot use "$" formatting character because it's not in the ISO C99. * @new_url is newly allocated URL built from @template. Caller must free it. * Return IE_SUCCESS, or corresponding error code and @new_url will not be * allocated. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libisds-0.10.1/src/utils.c new/libisds-0.10.3/src/utils.c --- old/libisds-0.10.1/src/utils.c 2015-01-02 21:50:23.000000000 +0100 +++ new/libisds-0.10.3/src/utils.c 2016-03-18 17:51:18.000000000 +0100 @@ -6,6 +6,7 @@ #ifndef _WIN32 #include <langinfo.h> #endif +#include <limits.h> #include <time.h> #include <errno.h> #include "utils.h" @@ -329,3 +330,8 @@ return -1; } + +/* Convert size_t to int. */ +_hidden int _isds_sizet2int(size_t val) { + return (val <= INT_MAX) ? (int) val : -1; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libisds-0.10.1/src/utils.h new/libisds-0.10.3/src/utils.h --- old/libisds-0.10.1/src/utils.h 2013-04-09 21:38:28.000000000 +0200 +++ new/libisds-0.10.3/src/utils.h 2016-03-18 17:51:18.000000000 +0100 @@ -98,6 +98,12 @@ * @return (time_t) -1 in case of error */ time_t _isds_timegm(struct tm *broken_utc); +/* Convert size_t to int. + * @val Value to be converted to int. + * @return value converted to int or -1 when the supplied value is too large + * to fit into integer. */ +int _isds_sizet2int(size_t val); + /* Free() and set to NULL pointed memory */ #define zfree(memory) { \ free(memory); \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libisds-0.10.1/test/offline/Makefile.am new/libisds-0.10.3/test/offline/Makefile.am --- old/libisds-0.10.1/test/offline/Makefile.am 2014-12-31 20:54:27.000000000 +0100 +++ new/libisds-0.10.3/test/offline/Makefile.am 2016-03-18 17:51:00.000000000 +0100 @@ -32,12 +32,11 @@ isds_DbOwnerInfo_duplicate isds_DbUserInfo_duplicate \ isds-filemetatype isds-hash_algorithm \ isds-timestring2timeval \ - isds-uint2isds_message_status isds-eventstring2event \ - isds-interpret_matches + isds-uint2isds_message_status isds-eventstring2event if BUILD_CURL TESTS += isds-dbtype isds-sendertype isds-usertype isds-paymenttype\ isds-crediteventtype isds-datestring2tm isds-tm2datestring \ - isds-timeval2timestring \ + isds-timeval2timestring isds-interpret_matches \ soap-decode_header_value soap-string2isds_otp_resolution endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libisds-0.10.1/test/simline/http.c new/libisds-0.10.3/test/simline/http.c --- old/libisds-0.10.1/test/simline/http.c 2015-01-04 17:21:37.000000000 +0100 +++ new/libisds-0.10.3/test/simline/http.c 2016-03-18 17:51:13.000000000 +0100 @@ -26,13 +26,13 @@ typedef enum { - step_A, step_B, step_C + step_A, step_B, step_C } base64_encodestep; typedef struct { - base64_encodestep step; - int8_t result; - int stepcount; /* number of encoded octet triplets on a line, + base64_encodestep step; + int8_t result; + int stepcount; /* number of encoded octet triplets on a line, or -1 to for end-less line */ } base64_encodestate; @@ -42,64 +42,64 @@ * @one_line is false for multi-line MIME encoding, * true for endless one-line format. */ static void base64_init_encodestate(base64_encodestate* state_in, _Bool one_line) { - state_in->step = step_A; - state_in->result = 0; - state_in->stepcount = (one_line) ? -1 : 0; + state_in->step = step_A; + state_in->result = 0; + state_in->stepcount = (one_line) ? -1 : 0; } static int8_t base64_encode_value(int8_t value_in) { /* XXX: CHAR_BIT == 8 because of <stdint.h> */ - static const int8_t encoding[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - if (value_in > 63) return '='; - return encoding[value_in]; + static const int8_t encoding[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + if (value_in > 63) return '='; + return encoding[value_in]; } static size_t base64_encode_block(const int8_t* plaintext_in, size_t length_in, int8_t *code_out, base64_encodestate* state_in) { - const int8_t *plainchar = plaintext_in; - const int8_t* const plaintextend = plaintext_in + length_in; - int8_t *codechar = code_out; - int8_t result; - int8_t fragment; - - result = state_in->result; - - switch (state_in->step) { - while (1) { - case step_A: - if (plainchar == plaintextend) { - state_in->result = result; - state_in->step = step_A; - return codechar - code_out; - } - fragment = *plainchar++; - result = (fragment & 0x0fc) >> 2; - *codechar++ = base64_encode_value(result); - result = (fragment & 0x003) << 4; - case step_B: - if (plainchar == plaintextend) { - state_in->result = result; - state_in->step = step_B; - return codechar - code_out; - } - fragment = *plainchar++; - result |= (fragment & 0x0f0) >> 4; - *codechar++ = base64_encode_value(result); - result = (fragment & 0x00f) << 2; - case step_C: - if (plainchar == plaintextend) { - state_in->result = result; - state_in->step = step_C; - return codechar - code_out; - } - fragment = *plainchar++; - result |= (fragment & 0x0c0) >> 6; - *codechar++ = base64_encode_value(result); - result = (fragment & 0x03f) >> 0; - *codechar++ = base64_encode_value(result); - + const int8_t *plainchar = plaintext_in; + const int8_t* const plaintextend = plaintext_in + length_in; + int8_t *codechar = code_out; + int8_t result; + int8_t fragment; + + result = state_in->result; + + switch (state_in->step) { + while (1) { + case step_A: + if (plainchar == plaintextend) { + state_in->result = result; + state_in->step = step_A; + return codechar - code_out; + } + fragment = *plainchar++; + result = (fragment & 0x0fc) >> 2; + *codechar++ = base64_encode_value(result); + result = (fragment & 0x003) << 4; + case step_B: + if (plainchar == plaintextend) { + state_in->result = result; + state_in->step = step_B; + return codechar - code_out; + } + fragment = *plainchar++; + result |= (fragment & 0x0f0) >> 4; + *codechar++ = base64_encode_value(result); + result = (fragment & 0x00f) << 2; + case step_C: + if (plainchar == plaintextend) { + state_in->result = result; + state_in->step = step_C; + return codechar - code_out; + } + fragment = *plainchar++; + result |= (fragment & 0x0c0) >> 6; + *codechar++ = base64_encode_value(result); + result = (fragment & 0x03f) >> 0; + *codechar++ = base64_encode_value(result); + if (state_in->stepcount >= 0) { ++(state_in->stepcount); if (state_in->stepcount == CHARS_PER_LINE/4) { @@ -107,35 +107,35 @@ state_in->stepcount = 0; } } - } /* while */ - } /* switch */ + } /* while */ + } /* switch */ - /* control should not reach here */ - return codechar - code_out; + /* control should not reach here */ + return codechar - code_out; } static size_t base64_encode_blockend(int8_t *code_out, base64_encodestate* state_in) { - int8_t *codechar = code_out; - - switch (state_in->step) { - case step_B: - *codechar++ = base64_encode_value(state_in->result); - *codechar++ = '='; - *codechar++ = '='; - break; - case step_C: - *codechar++ = base64_encode_value(state_in->result); - *codechar++ = '='; - break; - case step_A: - break; - } + int8_t *codechar = code_out; + + switch (state_in->step) { + case step_B: + *codechar++ = base64_encode_value(state_in->result); + *codechar++ = '='; + *codechar++ = '='; + break; + case step_C: + *codechar++ = base64_encode_value(state_in->result); + *codechar++ = '='; + break; + case step_A: + break; + } if (state_in->stepcount >= 0) *codechar++ = '\n'; - - return codechar - code_out; + + return codechar - code_out; } @@ -283,7 +283,7 @@ /* And exit */ return HTTP_ERROR_SUCCESS; } - + if (*buffer_size == *buffer_used) { /* Grow buffer */ tmp = realloc(*buffer, *buffer_size + BURST); @@ -399,7 +399,7 @@ /* And exit */ return HTTP_ERROR_SUCCESS; } - + if (*buffer_size == *buffer_used) { /* Grow buffer */ tmp = realloc(*buffer, *buffer_size + BURST); @@ -473,11 +473,11 @@ return HTTP_ERROR_SERVER; error = http_write_line(connection, buffer); free(buffer); - + return error; } - + /* Parse generic HTTP header. * @request is pre-allocated HTTP request. * @return 0 if success, negative value if internal error, positive value if @@ -563,11 +563,11 @@ return HTTP_ERROR_SERVER; error = http_write_line(connection, buffer); free(buffer); - + return error; } - + /* Find Content-Length value in HTTP request headers and set it into @request. * @return 0 in success. */ static int find_content_length(struct http_request *request) { @@ -692,7 +692,7 @@ /* Status line */ error = http_write_response_status(connection, response); if (error) return error; - + /* Headers */ for (struct http_header *header = response->headers; header != NULL; header = header->next) { @@ -766,7 +766,7 @@ free(path_parameter); return header; } - + /* Send a 200 Ok response with a cookie */ int http_send_response_200_cookie(const struct http_connection *connection, @@ -787,7 +787,7 @@ .body_length = body_length, .body = (void *)body }; - + if (cokie_name != NULL) { if (NULL == (header_cookie = http_build_setcookie_header( cokie_name, cookie_value, cookie_domain, cookie_path))) @@ -803,7 +803,7 @@ header_cookie->next = response.headers; response.headers = header_cookie; } - + retval = http_write_response(connection, &response); http_header_free(&header_cookie); return retval; @@ -845,7 +845,7 @@ return http_send_response_500(connection, "Could not build Set-Cookie header"); } - + /* Link defined headers */ if (location != NULL) { response.headers = &header_location; @@ -854,7 +854,7 @@ header_cookie->next = response.headers; response.headers = header_cookie; } - + retval = http_write_response(connection, &response); http_header_free(&header_cookie); return retval; @@ -886,7 +886,7 @@ .body_length = 0, .body = NULL }; - + /* Link defined headers */ if (location != NULL) { response.headers = &header_location; @@ -899,7 +899,7 @@ header_code.next = response.headers; response.headers = &header_code; } - + return http_write_response(connection, &response); } @@ -915,7 +915,7 @@ .body_length = 0, .body = NULL }; - + return http_write_response(connection, &response); } @@ -934,7 +934,7 @@ .body_length = 0, .body = NULL }; - + return http_write_response(connection, &response); } @@ -972,7 +972,7 @@ return http_send_response_500(connection, "Could not build WWW-Authenticate header value"); } - + /* Link defined headers */ if (code != NULL) header.next = &header_code; if (text != NULL) { @@ -997,7 +997,7 @@ .body_length = 0, .body = NULL }; - + return http_write_response(connection, &response); } @@ -1013,7 +1013,7 @@ .body_length = 0, .body = NULL }; - + return http_write_response(connection, &response); } @@ -1032,7 +1032,7 @@ .body_length = body_length, .body = (void *)body }; - + return http_write_response(connection, &response); } @@ -1074,13 +1074,13 @@ if (strncmp(header->value, "Basic ", 6)) return HTTP_ERROR_CLIENT; basic_cookie_client = header->value + 6; - + if (-1 == test_asprintf(&basic_cookie_plain, "%s:%s", (username == NULL) ? "" : username, (password == NULL) ? "" : password)) { return HTTP_ERROR_SERVER; } - + basic_cookie_encoded = base64encode(basic_cookie_plain, strlen(basic_cookie_plain), 1); if (basic_cookie_encoded == NULL) {
