diff --git a/src/encoding/armor.js b/src/encoding/armor.js index 47442c34..6011b94c 100644 --- a/src/encoding/armor.js +++ b/src/encoding/armor.js @@ -369,21 +369,18 @@ export function armor(messageType, body, partIndex, partTotal, customComment, co hash = body.hash; body = body.data; } - const bodyClone = stream.passiveClone(body); const result = []; switch (messageType) { case enums.armor.multipartSection: result.push('-----BEGIN PGP MESSAGE, PART ' + partIndex + '/' + partTotal + '-----\n'); result.push(addheader(customComment, config)); result.push(base64.encode(body)); - result.push('=', getCheckSum(bodyClone)); result.push('-----END PGP MESSAGE, PART ' + partIndex + '/' + partTotal + '-----\n'); break; case enums.armor.multipartLast: result.push('-----BEGIN PGP MESSAGE, PART ' + partIndex + '-----\n'); result.push(addheader(customComment, config)); result.push(base64.encode(body)); - result.push('=', getCheckSum(bodyClone)); result.push('-----END PGP MESSAGE, PART ' + partIndex + '-----\n'); break; case enums.armor.signed: @@ -393,35 +390,30 @@ export function armor(messageType, body, partIndex, partTotal, customComment, co result.push('\n-----BEGIN PGP SIGNATURE-----\n'); result.push(addheader(customComment, config)); result.push(base64.encode(body)); - result.push('=', getCheckSum(bodyClone)); result.push('-----END PGP SIGNATURE-----\n'); break; case enums.armor.message: result.push('-----BEGIN PGP MESSAGE-----\n'); result.push(addheader(customComment, config)); result.push(base64.encode(body)); - result.push('=', getCheckSum(bodyClone)); result.push('-----END PGP MESSAGE-----\n'); break; case enums.armor.publicKey: result.push('-----BEGIN PGP PUBLIC KEY BLOCK-----\n'); result.push(addheader(customComment, config)); result.push(base64.encode(body)); - result.push('=', getCheckSum(bodyClone)); result.push('-----END PGP PUBLIC KEY BLOCK-----\n'); break; case enums.armor.privateKey: result.push('-----BEGIN PGP PRIVATE KEY BLOCK-----\n'); result.push(addheader(customComment, config)); result.push(base64.encode(body)); - result.push('=', getCheckSum(bodyClone)); result.push('-----END PGP PRIVATE KEY BLOCK-----\n'); break; case enums.armor.signature: result.push('-----BEGIN PGP SIGNATURE-----\n'); result.push(addheader(customComment, config)); result.push(base64.encode(body)); - result.push('=', getCheckSum(bodyClone)); result.push('-----END PGP SIGNATURE-----\n'); break; } diff --git a/test/general/armor.js b/test/general/armor.js index 10624ee2..7f7c788b 100644 --- a/test/general/armor.js +++ b/test/general/armor.js @@ -379,7 +379,6 @@ VWx8AtKEInT8YvN19cS2Jpr81jCN819IqgDr+YQezYMwZMzWISmA3w5Z3UCU lO771jlg4fHlWOZ2nJqselFlNc3X/VoZ8swmMkI6KVDV+rKaeyTWe61Up0Jj NJCB6+LWtabSoVIjNVgKwyKqyTLaESNwC2ogZwkdE8qPGiDFEHo4Gg9zuRof -=trqv -----END PGP PUBLIC KEY BLOCK----- `; @@ -390,7 +389,7 @@ NJCB6+LWtabSoVIjNVgKwyKqyTLaESNwC2ogZwkdE8qPGiDFEHo4Gg9zuRof .replace(/^(Version|Comment): .*$\n/mg, '') ).to.equal( pubKey - .replace('\n=', '=') + .replace('\n-', '-') .replace(/\n\r/g, '\n') ); });