[Rt-commit] r8849 - rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt
ruz at bestpractical.com
ruz at bestpractical.com
Thu Aug 30 18:47:33 EDT 2007
Author: ruz
Date: Thu Aug 30 18:47:32 2007
New Revision: 8849
Modified:
rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm
Log:
* decrypt even if we can't verify signature
Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm (original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm Thu Aug 30 18:47:32 2007
@@ -1075,8 +1075,9 @@
$RT::Logger->warning( $res{'error'} ) if $res{'error'};
$RT::Logger->error( $res{'logger'} ) if $res{'logger'} && $?;
- # if the encryption is fine but the signature is bad, then without this
+ # if the decryption is fine but the signature is bad, then without this
# status check we lose the decrypted text
+ # XXX: add argument to the function to control this check
if ( $res{'status'} !~ /DECRYPTION_OKAY/ ) {
if ( $@ || $? ) {
$res{'message'} = $@? $@: "gpg exitted with error code ". ($? >> 8);
@@ -1153,9 +1154,15 @@
$RT::Logger->debug( $res{'status'} ) if $res{'status'};
$RT::Logger->warning( $res{'error'} ) if $res{'error'};
$RT::Logger->error( $res{'logger'} ) if $res{'logger'} && $?;
- if ( $@ || $? ) {
- $res{'message'} = $@? $@: "gpg exitted with error code ". ($? >> 8);
- return %res;
+
+ # if the decryption is fine but the signature is bad, then without this
+ # status check we lose the decrypted text
+ # XXX: add argument to the function to control this check
+ if ( $res{'status'} !~ /DECRYPTION_OKAY/ ) {
+ if ( $@ || $? ) {
+ $res{'message'} = $@? $@: "gpg exitted with error code ". ($? >> 8);
+ return %res;
+ }
}
seek $tmp_fh, 0, 0;
More information about the Rt-commit
mailing list