diff --git a/src/ciphers/openpgp.cfb.js b/src/ciphers/openpgp.cfb.js index 118dc504..ecbf6a44 100644 --- a/src/ciphers/openpgp.cfb.js +++ b/src/ciphers/openpgp.cfb.js @@ -179,7 +179,8 @@ function openpgp_cfb_decrypt(blockcipherencryptfn, block_size, key, ciphertext, util.print_debug("resync:"+resync); var iblock = new Array(block_size); var ablock = new Array(block_size); - var i, n, text = ''; + var i, n = ''; + var text = []; // initialisation vector for(i=0; i < block_size; i++) iblock[i] = 0; @@ -201,7 +202,7 @@ function openpgp_cfb_decrypt(blockcipherencryptfn, block_size, key, ciphertext, || iblock[block_size-1]!=(ablock[1]^ciphertext.charCodeAt(block_size+1))) { util.print_eror("error duding decryption. Symmectric encrypted data not valid."); - return text; + return text.join(''); } /* RFC4880: Tag 18 and Resync: @@ -220,7 +221,7 @@ function openpgp_cfb_decrypt(blockcipherencryptfn, block_size, key, ciphertext, for(i = 0; i 38) - util.print_debug("openpgp.msg.messge decrypt:\n"+util.hexstrdump(decrypted.substring(position))); + util.print_debug_hexstr_dump("openpgp.msg.messge decrypt:\n",decrypted.substring(position)); len = decrypted.length - position; if (packet.tagType == 11) { this.text = packet.data; @@ -132,4 +132,4 @@ function openpgp_msg_message() { this.decrypt = decrypt; this.verifySignature = verifySignature; this.toString = toString; -} \ No newline at end of file +} diff --git a/src/packet/openpgp.packet.encryptedintegrityprotecteddata.js b/src/packet/openpgp.packet.encryptedintegrityprotecteddata.js index 9f5c380e..98192656 100644 --- a/src/packet/openpgp.packet.encryptedintegrityprotecteddata.js +++ b/src/packet/openpgp.packet.encryptedintegrityprotecteddata.js @@ -137,6 +137,11 @@ function openpgp_packet_encryptedintegrityprotecteddata() { } function toString() { + var data = ''; + if(openpgp.config.debug) + data = ' data: Bytes [' + + util.hexstrdump(this.encryptedData) + ']'; + return '5.13. Sym. Encrypted Integrity Protected Data Packet (Tag 18)\n' + ' length: ' + this.packetLength @@ -144,8 +149,7 @@ function openpgp_packet_encryptedintegrityprotecteddata() { + ' version: ' + this.version + '\n' - + ' data: Bytes [' - + util.hexstrdump(this.encryptedData) + ']'; + + data; } this.write_packet = write_packet;