Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: devel

does gpg ever write to stdout in if a file could not be decrypted?

 

 

GnuPG devel RSS feed   Index | Next | Previous | View Threaded


philcerf at googlemail

Nov 21, 2009, 6:38 AM

Post #1 of 2 (428 views)
Permalink
does gpg ever write to stdout in if a file could not be decrypted?

Hi.

Minor question:
Say I use gpg in batch mode to decrypt a file to stdout. Of course
this might fail (the passphrase might be wrong, or the message
corrupted).
In this case, the exist status will be != 0, right?
But could it EVER happen, that gpg still printed something to stdout?

I mean imagine very big files... I cannot believe that gpg caches them
until it knows whether decryption has successful or not?!
And I also speak of such encrypted files which don't have this check value set.

Best wishes,
Philippe

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


wk at gnupg

Nov 23, 2009, 2:59 AM

Post #2 of 2 (396 views)
Permalink
Re: does gpg ever write to stdout in if a file could not be decrypted? [In reply to]

On Sat, 21 Nov 2009 15:38, philcerf [at] googlemail said:

> But could it EVER happen, that gpg still printed something to stdout?

Sure, if gpg detects that the file was corrupt it might have even
wirtten the whole plaintext out before it has the oppurtunity to check
the MIC (message integrity code) or the signature. You can't avoid
that. The exit code will be not 0 in that case.

> I mean imagine very big files... I cannot believe that gpg caches them
> until it knows whether decryption has successful or not?!

Right, it does noch cache a file so that it can be used in a pipeline.

To see what really went fron you should check the status code emitted to
the file descriptor given by --status-FD N. Or use GPGME, which does
return anice stat about the decryption process. Anyway, you need to
throw away the failed decrypted text yourself.


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel

GnuPG devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.