mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-06-24 15:12:31 +00:00
Don't generate armor checksum lines
This commit is contained in:
parent
b077504b3c
commit
762775bc03
@ -369,21 +369,18 @@ export function armor(messageType, body, partIndex, partTotal, customComment, co
|
|||||||
hash = body.hash;
|
hash = body.hash;
|
||||||
body = body.data;
|
body = body.data;
|
||||||
}
|
}
|
||||||
const bodyClone = stream.passiveClone(body);
|
|
||||||
const result = [];
|
const result = [];
|
||||||
switch (messageType) {
|
switch (messageType) {
|
||||||
case enums.armor.multipartSection:
|
case enums.armor.multipartSection:
|
||||||
result.push('-----BEGIN PGP MESSAGE, PART ' + partIndex + '/' + partTotal + '-----\n');
|
result.push('-----BEGIN PGP MESSAGE, PART ' + partIndex + '/' + partTotal + '-----\n');
|
||||||
result.push(addheader(customComment, config));
|
result.push(addheader(customComment, config));
|
||||||
result.push(base64.encode(body));
|
result.push(base64.encode(body));
|
||||||
result.push('=', getCheckSum(bodyClone));
|
|
||||||
result.push('-----END PGP MESSAGE, PART ' + partIndex + '/' + partTotal + '-----\n');
|
result.push('-----END PGP MESSAGE, PART ' + partIndex + '/' + partTotal + '-----\n');
|
||||||
break;
|
break;
|
||||||
case enums.armor.multipartLast:
|
case enums.armor.multipartLast:
|
||||||
result.push('-----BEGIN PGP MESSAGE, PART ' + partIndex + '-----\n');
|
result.push('-----BEGIN PGP MESSAGE, PART ' + partIndex + '-----\n');
|
||||||
result.push(addheader(customComment, config));
|
result.push(addheader(customComment, config));
|
||||||
result.push(base64.encode(body));
|
result.push(base64.encode(body));
|
||||||
result.push('=', getCheckSum(bodyClone));
|
|
||||||
result.push('-----END PGP MESSAGE, PART ' + partIndex + '-----\n');
|
result.push('-----END PGP MESSAGE, PART ' + partIndex + '-----\n');
|
||||||
break;
|
break;
|
||||||
case enums.armor.signed:
|
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('\n-----BEGIN PGP SIGNATURE-----\n');
|
||||||
result.push(addheader(customComment, config));
|
result.push(addheader(customComment, config));
|
||||||
result.push(base64.encode(body));
|
result.push(base64.encode(body));
|
||||||
result.push('=', getCheckSum(bodyClone));
|
|
||||||
result.push('-----END PGP SIGNATURE-----\n');
|
result.push('-----END PGP SIGNATURE-----\n');
|
||||||
break;
|
break;
|
||||||
case enums.armor.message:
|
case enums.armor.message:
|
||||||
result.push('-----BEGIN PGP MESSAGE-----\n');
|
result.push('-----BEGIN PGP MESSAGE-----\n');
|
||||||
result.push(addheader(customComment, config));
|
result.push(addheader(customComment, config));
|
||||||
result.push(base64.encode(body));
|
result.push(base64.encode(body));
|
||||||
result.push('=', getCheckSum(bodyClone));
|
|
||||||
result.push('-----END PGP MESSAGE-----\n');
|
result.push('-----END PGP MESSAGE-----\n');
|
||||||
break;
|
break;
|
||||||
case enums.armor.publicKey:
|
case enums.armor.publicKey:
|
||||||
result.push('-----BEGIN PGP PUBLIC KEY BLOCK-----\n');
|
result.push('-----BEGIN PGP PUBLIC KEY BLOCK-----\n');
|
||||||
result.push(addheader(customComment, config));
|
result.push(addheader(customComment, config));
|
||||||
result.push(base64.encode(body));
|
result.push(base64.encode(body));
|
||||||
result.push('=', getCheckSum(bodyClone));
|
|
||||||
result.push('-----END PGP PUBLIC KEY BLOCK-----\n');
|
result.push('-----END PGP PUBLIC KEY BLOCK-----\n');
|
||||||
break;
|
break;
|
||||||
case enums.armor.privateKey:
|
case enums.armor.privateKey:
|
||||||
result.push('-----BEGIN PGP PRIVATE KEY BLOCK-----\n');
|
result.push('-----BEGIN PGP PRIVATE KEY BLOCK-----\n');
|
||||||
result.push(addheader(customComment, config));
|
result.push(addheader(customComment, config));
|
||||||
result.push(base64.encode(body));
|
result.push(base64.encode(body));
|
||||||
result.push('=', getCheckSum(bodyClone));
|
|
||||||
result.push('-----END PGP PRIVATE KEY BLOCK-----\n');
|
result.push('-----END PGP PRIVATE KEY BLOCK-----\n');
|
||||||
break;
|
break;
|
||||||
case enums.armor.signature:
|
case enums.armor.signature:
|
||||||
result.push('-----BEGIN PGP SIGNATURE-----\n');
|
result.push('-----BEGIN PGP SIGNATURE-----\n');
|
||||||
result.push(addheader(customComment, config));
|
result.push(addheader(customComment, config));
|
||||||
result.push(base64.encode(body));
|
result.push(base64.encode(body));
|
||||||
result.push('=', getCheckSum(bodyClone));
|
|
||||||
result.push('-----END PGP SIGNATURE-----\n');
|
result.push('-----END PGP SIGNATURE-----\n');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -379,7 +379,6 @@ VWx8AtKEInT8YvN19cS2Jpr81jCN819IqgDr+YQezYMwZMzWISmA3w5Z3UCU
|
|||||||
lO771jlg4fHlWOZ2nJqselFlNc3X/VoZ8swmMkI6KVDV+rKaeyTWe61Up0Jj
|
lO771jlg4fHlWOZ2nJqselFlNc3X/VoZ8swmMkI6KVDV+rKaeyTWe61Up0Jj
|
||||||
NJCB6+LWtabSoVIjNVgKwyKqyTLaESNwC2ogZwkdE8qPGiDFEHo4Gg9zuRof
|
NJCB6+LWtabSoVIjNVgKwyKqyTLaESNwC2ogZwkdE8qPGiDFEHo4Gg9zuRof
|
||||||
|
|
||||||
=trqv
|
|
||||||
-----END PGP PUBLIC KEY BLOCK-----
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@ -390,7 +389,7 @@ NJCB6+LWtabSoVIjNVgKwyKqyTLaESNwC2ogZwkdE8qPGiDFEHo4Gg9zuRof
|
|||||||
.replace(/^(Version|Comment): .*$\n/mg, '')
|
.replace(/^(Version|Comment): .*$\n/mg, '')
|
||||||
).to.equal(
|
).to.equal(
|
||||||
pubKey
|
pubKey
|
||||||
.replace('\n=', '=')
|
.replace('\n-', '-')
|
||||||
.replace(/\n\r/g, '\n')
|
.replace(/\n\r/g, '\n')
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user