[poppler] 2 commits - poppler/Form.cc poppler/Form.h poppler/SignatureHandler.cc poppler/SignatureHandler.h poppler/SignatureInfo.cc poppler/SignatureInfo.h qt5/src utils/pdfsig.1 utils/pdfsig.cc

Jüttner, Hans-Ulrich huj at froreich-bioscientia.de
Tue Aug 15 12:25:07 UTC 2017


Hello,

you added <hasht.h> to the includes instead of defining
HASH_HashType again. But hasht.h from nss isn't found
when compiling utils/pdfsig.cc.

Best regards,
Ulrich

Am 15.08.2017 um 12:57 schrieb Albert Astals Cid:
>   poppler/Form.cc             |  171 ++++++++++++++++++++++++++++++++++++++++++--
>   poppler/Form.h              |   28 ++++++-
>   poppler/SignatureHandler.cc |   34 +++++++-
>   poppler/SignatureHandler.h  |    8 +-
>   poppler/SignatureInfo.cc    |   38 +++++++++
>   poppler/SignatureInfo.h     |   11 ++
>   qt5/src/poppler-form.cc     |  120 ++++++++++++++++++++++++++++++
>   qt5/src/poppler-form.h      |   77 +++++++++++++++++++
>   utils/pdfsig.1              |    6 +
>   utils/pdfsig.cc             |   66 ++++++++++++++++
>   10 files changed, 533 insertions(+), 26 deletions(-)
>
> New commits:
> commit b56a697c58bcf09063827b9c109be9c04a033b8a
> Author: Albert Astals Cid <aacid at kde.org>
> Date:   Tue Aug 15 12:25:26 2017 +0200
>
>      Improvements to the previous Signature commit
>      
>       * Remove FormWidgetSignature::setFormSignatureType, the API was weird,
>      make it be an output parameter of getCheckedSignature
>      
>       * include cleanup
>      
>       * Make validation time mandatory, marking to use -1 for *now*
>      
>       * Remove setFormSignatureType noone uses
>      
>       * Fix compilation wihtout NSS3
>      
>       * Don't static cast between NSS3 HASH_HashType and poppler-qt5 HashAlgorithm
>      
>       * Actually pass validationTime down in FormFieldSignature::validate
>      
>       * Add since markers to poppler-qt5 functions/enums
>      
>       * Fix spacing
>      
>       * Remove SignatureValidationInfo::signingDateTime that returns
>      QDateTime, having two functions that return the same is a bit confusing,
>      and we're not filling the timezone info anyway, so let it be a time_t
(snip)
> diff --git a/utils/pdfsig.cc b/utils/pdfsig.cc
> index b2cc14af..8b5182d9 100644
> --- a/utils/pdfsig.cc
> +++ b/utils/pdfsig.cc
> @@ -6,7 +6,7 @@
>   //
>   // Copyright 2015 André Guerreiro <aguerreiro1985 at gmail.com>
>   // Copyright 2015 André Esser <bepandre at hotmail.com>
> -// Copyright 2015 Albert Astals Cid <aacid at kde.org>
> +// Copyright 2015, 2017 Albert Astals Cid <aacid at kde.org>
>   // Copyright 2016 Markus Kilås <digital at markuspage.com>
>   // Copyright 2017 Hans-Ulrich Jüttner <huj at froreich-bioscientia.de>
>   //
> @@ -19,7 +19,7 @@
>   #include <stddef.h>
>   #include <string.h>
>   #include <time.h>
> -#include "goo/GooList.h"
> +#include <hasht.h>
>   #include "parseargs.h"
>   #include "Object.h"
>   #include "Array.h"
> @@ -30,20 +30,6 @@
>   #include "GlobalParams.h"
>   #include "SignatureInfo.h"
>   
> -
> -enum HASH_HashType
> -{
> -    HASH_AlgNULL = 0,
> -    HASH_AlgMD2 = 1,
> -    HASH_AlgMD5 = 2,
> -    HASH_AlgSHA1 = 3,
> -    HASH_AlgSHA256 = 4,
> -    HASH_AlgSHA384 = 5,
> -    HASH_AlgSHA512 = 6,
> -    HASH_AlgSHA224 = 7,
> -    HASH_AlgTOTAL
> -};
> -
>   const char * getReadableSigState(SignatureValidationStatus sig_vs)
>   {
>     switch(sig_vs) {
> @@ -169,7 +155,7 @@ int main(int argc, char *argv[])
>     }
>   
>     for (unsigned int i = 0; i < sigCount; i++) {
> -    sig_info = sig_widgets.at(i)->validateSignature(!dontVerifyCert, false);
> +    sig_info = sig_widgets.at(i)->validateSignature(!dontVerifyCert, false, -1 /* now */);
>       printf("Signature #%u:\n", i+1);
>       printf("  - Signer Certificate Common Name: %s\n", sig_info->getSignerName());
>       printf("  - Signer full Distinguished Name: %s\n", sig_info->getSubjectDN());
> @@ -222,8 +208,9 @@ int main(int argc, char *argv[])
>         int i = 0;
>         printf("  - Signed Ranges: [%lld - %lld], [%lld - %lld]\n",
>                ranges[0], ranges[1], ranges[2], ranges[3]);
> -      GooString* signature = sig_widgets.at(i)->getCheckedSignature();
> -      if (signature && sig_widgets.at(i)->getCheckedFileSize() == ranges[3])
> +      Goffset checked_file_size;
> +      GooString* signature = sig_widgets.at(i)->getCheckedSignature(&checked_file_size);
> +      if (signature && checked_file_size == ranges[3])
>         {
>           printf("  - Total document signed\n");
>           delete signature;
(snip)

-- 
Dr. Hans-Ulrich Jüttner
Software Development

Labor Dr. von Froreich - Bioscientia GmbH
Großmoorbogen 25
21079 Hamburg
Deutschland

Fon +49 (40) 766 96-305
Fax +49 (40) 766 96-334
Web www.froreich-bioscientia.de


More information about the poppler mailing list