GPG ignores whitespace at line end

This is a discussion on GPG ignores whitespace at line end within the Linux Security forums, part of the System Security and Security Related category; Hello All, There's a funny thing with GPG i just discovered for myself. If you create a message "...


Go Back   Usenet Forums > System Security and Security Related > Linux Security

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-29-2004
Artiom
 
Posts: n/a
Default GPG ignores whitespace at line end

Hello All,

There's a funny thing with GPG i just discovered for myself. If you
create a message "foobar", sign it with gpg --clearsign, then add some
whitespace to signed message after foobar, signature is still good.
Tested with gpg 1.2.3 and 1.2.5.

Is this an intended behaviour? If it is, where should i look for more
info (yes, i already searched through the google =).

Regards,
Artiom
Reply With Quote
  #2 (permalink)  
Old 11-29-2004
Neil W Rickert
 
Posts: n/a
Default Re: GPG ignores whitespace at line end

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

artiom@phreaker.net (Artiom) writes:

>There's a funny thing with GPG i just discovered for myself. If you
>create a message "foobar", sign it with gpg --clearsign, then add some
>whitespace to signed message after foobar, signature is still good.
>Tested with gpg 1.2.3 and 1.2.5.


>Is this an intended behaviour? If it is, where should i look for more
>info (yes, i already searched through the google =).


This is intended behavior. When you use "--clearsign", that
specifies textmode. In textmode, the line endings are put into
canonical for when creating the signature and when verifying the
signature. There is control info in the signature which indicates
that textmode was used, so that the verification will also use it.

Part of the canonification of line endings is to strip trailing
spaces.

Your gpg man pages probably say something about this.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.3.91 (SunOS)

iD8DBQFBqywEvmGe70vHPUMRAi+GAKD3Ge0hlXYaqr5cOQ+Jt4 DXq5qZSwCg8aAX
n2yZFT/IfTd0TZsk/z8ZZMI=
=OAQM
-----END PGP SIGNATURE-----

Reply With Quote
  #3 (permalink)  
Old 12-01-2004
David Shaw
 
Posts: n/a
Default Re: GPG ignores whitespace at line end

Neil W Rickert <rickert+nn@cs.niu.edu> wrote:

> artiom@phreaker.net (Artiom) writes:
>
>>There's a funny thing with GPG i just discovered for myself. If you
>>create a message "foobar", sign it with gpg --clearsign, then add some
>>whitespace to signed message after foobar, signature is still good.
>>Tested with gpg 1.2.3 and 1.2.5.

>
>>Is this an intended behaviour? If it is, where should i look for more
>>info (yes, i already searched through the google =).

>
> This is intended behavior. When you use "--clearsign", that
> specifies textmode. In textmode, the line endings are put into
> canonical for when creating the signature and when verifying the
> signature. There is control info in the signature which indicates
> that textmode was used, so that the verification will also use it.
>
> Part of the canonification of line endings is to strip trailing
> spaces.


All true, but just for completeness: --clearsign disregards both
spaces and tabs at the end of the line. The main historical reason
for this is that email gateways sometimes did abusive things to line
endings.

David
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 01:41 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0