From f07702e8672e379e7ab54412d4b251065d21ac15 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Thu, 5 Dec 2013 12:29:52 -0800 Subject: [PATCH] More consistency changes --- src/packet/openpgp.packet.signature.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/packet/openpgp.packet.signature.js b/src/packet/openpgp.packet.signature.js index 69dde877..8a43ae10 100644 --- a/src/packet/openpgp.packet.signature.js +++ b/src/packet/openpgp.packet.signature.js @@ -506,18 +506,18 @@ function openpgp_packet_signature() { break; case 1: // 0x01: Signature of a canonical text document. - var tohash = data.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n"); + var canonicalMsgText = data.replace(/\r/g,'').replace(/\n/g,"\r\n"); if (openpgp.config.debug) { - util.print_debug('tohash: '+util.hexdump(tohash)); + util.print_debug('canonicalMsgText: '+util.hexdump(canonicalMsgText)); util.print_debug('signatureData: '+util.hexdump(this.signatureData)); util.print_debug('trailer: '+util.hexdump(trailer)); } if (this.version == 4) { this.verified = openpgp_crypto_verifySignature(this.publicKeyAlgorithm, this.hashAlgorithm, - this.MPIs, key.obj.publicKeyPacket.MPIs, tohash+this.signatureData+trailer); + this.MPIs, key.obj.publicKeyPacket.MPIs, canonicalMsgText+this.signatureData+trailer); } else if (this.version == 3) { this.verified = openpgp_crypto_verifySignature(this.publicKeyAlgorithm, this.hashAlgorithm, - this.MPIs, key.obj.publicKeyPacket.MPIs, tohash+this.signatureData); + this.MPIs, key.obj.publicKeyPacket.MPIs, canonicalMsgText+this.signatureData); } else { this.verified = false; }