Signing problems...

Ted Cabeen secabeen at pobox.com
Mon Jun 19 15:10:40 CEST 2000


In message <20000619095908.H7445 at djebel.gnupg.de>, Werner Koch writes:
>On Mon, 19 Jun 2000, Alexander Zangerl wrote:
>
>> personally i think your problem is the same as mine, i.e. that
>> gpg does strip trailing whitespace correctly when signing
>> but not when checking the signature.
>
>Please, can someone track this down.  Thre are some commented
>md_start_debug() functions in the code which are quite useful for such
>kinds of problems.

Done.  Here's my patch.  From what I can tell, the problem was that the 
textmode flags defined for the entrypoints to plaintext.c were not being set 
based on the value of sig->sig_class like they should be.  This bug was 
introduced as part of a workaround for a PGP 2.6 bug.  

>From my reading we need to check the value of sig_class for both onepass 
signatures and regular signatures.  This patch checks for textmode in both 
cases.

Thoughts?  It works on the signatures I was having problems with earlier.

*** gnupg-1.0.1/g10/mainproc.c  Thu Dec 16 01:50:19 1999
--- gnupg-1.0.1-new/g10/mainproc.c      Mon Jun 19 14:04:18 2000
***************
*** 1174,1180 ****
                        n1? (n1->pkt->pkt.onepass_sig->sig_class == 0x01):0 );
            else
                rc = ask_for_detached_datafile( c->mfx.md, c->mfx.md2,
!                                           iobuf_get_fname(c->iobuf), 0 );
            if( rc ) {
                log_error("can't hash datafile: %s\n", g10_errstr(rc));
                return;
--- 1174,1181 ----
                        n1? (n1->pkt->pkt.onepass_sig->sig_class == 0x01):0 );
            else
                rc = ask_for_detached_datafile( c->mfx.md, c->mfx.md2,
!                                           iobuf_get_fname(c->iobuf), 
!                         n1? (n1->pkt->pkt.onepass_sig->sig_class == 0x01):0 );
            if( rc ) {
                log_error("can't hash datafile: %s\n", g10_errstr(rc));
                return;
***************
*** 1216,1226 ****
            if( c->sigs_only )
                rc = hash_datafiles( c->mfx.md, c->mfx.md2,
                                     c->signed_data, c->sigfilename,
!                                    c->mfx.md2? 0 :(sig->sig_class == 0x01) );
            else
                rc = ask_for_detached_datafile( c->mfx.md, c->mfx.md2,
                                         iobuf_get_fname(c->iobuf),
!                              c->mfx.md2? 0 :(sig->sig_class == 0x01) );
            if( rc ) {
                log_error("can't hash datafile: %s\n", g10_errstr(rc));
                return;
--- 1217,1227 ----
            if( c->sigs_only )
                rc = hash_datafiles( c->mfx.md, c->mfx.md2,
                                     c->signed_data, c->sigfilename,
!                                    (sig->sig_class == 0x01) );
            else
                rc = ask_for_detached_datafile( c->mfx.md, c->mfx.md2,
                                         iobuf_get_fname(c->iobuf),
!                                        (sig->sig_class == 0x01) );
            if( rc ) {
                log_error("can't hash datafile: %s\n", g10_errstr(rc));
                return;


--
Ted Cabeen           http://www.pobox.com/~secabeen         secabeen at pobox.com
Check Website or finger for PGP/GPG Public Key           secabeen at uchicago.edu
"I have taken all knowledge to be my province." -F. Bacon  secabeen at cabeen.org
"Human kind cannot bear very much reality."-T.S.Eliot        cabeen at netcom.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
Url : /pipermail/attachments/20000619/b52d6e64/attachment.bin


More information about the Gnupg-devel mailing list