Remove CP-1252 cleartext signature unit-test
This commit is contained in:
parent
5fd4bdbccb
commit
d22facc61c
File diff suppressed because one or more lines are too long
|
@ -81,8 +81,7 @@ CleartextMessage.prototype.verify = function(publicKeys) {
|
|||
var result = [];
|
||||
var signatureList = this.packets.filterByTag(enums.packet.signature);
|
||||
var literalDataPacket = new packet.literal();
|
||||
// we assume that cleartext signature is generated based on UTF8 cleartext,
|
||||
// fails for other encodings, see CP-1252 test case in test/signature.js
|
||||
// we assume that cleartext signature is generated based on UTF8 cleartext
|
||||
literalDataPacket.setText(this.text);
|
||||
publicKeys.forEach(function(pubKey) {
|
||||
for (var i = 0; i < signatureList.length; i++) {
|
||||
|
|
|
@ -417,38 +417,6 @@ var pub_key_arm3 =
|
|||
verified = verified && cleartextSig.signatures[0].valid;
|
||||
|
||||
return new unit.result("Sign text with openpgp.signClearMessage and verify with openpgp.verifyClearSignedMessage leads to same cleartext and valid signatures", verified);
|
||||
}, function() {
|
||||
|
||||
var msg_armor =
|
||||
['-----BEGIN PGP SIGNED MESSAGE-----',
|
||||
'Hash: SHA256',
|
||||
'',
|
||||
'äöü',
|
||||
'some',
|
||||
'more',
|
||||
'-----BEGIN PGP SIGNATURE-----',
|
||||
'Version: GnuPG v2.0.19 (GNU/Linux)',
|
||||
'',
|
||||
'iJwEAQEIAAYFAlKkbS8ACgkQ4IT3RGwgLJf/4wQAiG8s4CwL+YcvVaY/UVEuVCN+',
|
||||
'7Z/y9kNIU3MuPQy/7kiAV/f3mE488363LelrLuppZRpAmbYFmFCklK/xgXF1MfRQ',
|
||||
'J7ZGW0PrxQPi8KR8kSPzaUjkzUk86sARB0LeIxcG+5T/qh7fDXCRRyXPom5Ebqsf',
|
||||
'XCEfvvdJ60zitnlFiIY=',
|
||||
'=dm/N',
|
||||
'-----END PGP SIGNATURE-----'].join('\n');
|
||||
|
||||
var plaintext = 'äöü\nsome\nmore';
|
||||
var csMsg = openpgp.cleartext.readArmored(msg_armor);
|
||||
var pubKey2 = openpgp.key.readArmored(pub_key_arm2);
|
||||
|
||||
var keyids = csMsg.getSigningKeyIds();
|
||||
|
||||
var cleartextSig = openpgp.verifyClearSignedMessage([pubKey2], csMsg);
|
||||
|
||||
var verified = cleartextSig.text == plaintext;
|
||||
|
||||
verified = verified && cleartextSig.signatures[0].valid;
|
||||
|
||||
return new unit.result("Verify cleartext signed message with CP-1252 character encoding", verified);
|
||||
}];
|
||||
|
||||
var results = [];
|
||||
|
|
Loading…
Reference in New Issue
Block a user