mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-11-24 14:35:51 +00:00
Allow additional unexpected packets in the grammar checker
To make the grammar checker less of a breaking change in v6. This should be reverted in v7.
This commit is contained in:
parent
d94d9d462a
commit
b03eae5eca
@ -228,7 +228,6 @@ export default {
|
|||||||
* Parsing of packets is normally restricted to a predefined set of packets. For example a Sym. Encrypted Integrity Protected Data Packet can only
|
* Parsing of packets is normally restricted to a predefined set of packets. For example a Sym. Encrypted Integrity Protected Data Packet can only
|
||||||
* contain a certain set of packets including LiteralDataPacket. With this setting we can allow additional packets, which is probably not advisable
|
* contain a certain set of packets including LiteralDataPacket. With this setting we can allow additional packets, which is probably not advisable
|
||||||
* as a global config setting, but can be used for specific function calls (e.g. decrypt method of Message).
|
* as a global config setting, but can be used for specific function calls (e.g. decrypt method of Message).
|
||||||
* NB: `config.enforceGrammar` may need to be disabled as well.
|
|
||||||
* @memberof module:config
|
* @memberof module:config
|
||||||
* @property {Array} additionalAllowedPackets Allow additional packets on parsing. Defined as array of packet classes, e.g. [PublicKeyPacket]
|
* @property {Array} additionalAllowedPackets Allow additional packets on parsing. Defined as array of packet classes, e.g. [PublicKeyPacket]
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -58,8 +58,6 @@ export class MessageGrammarValidator {
|
|||||||
throw new GrammarError('Non-encrypted data packet following ESK packet');
|
throw new GrammarError('Non-encrypted data packet following ESK packet');
|
||||||
}
|
}
|
||||||
this.sawDataPacket = true;
|
this.sawDataPacket = true;
|
||||||
} else {
|
|
||||||
throw new GrammarError(`Unexpected packet: ${packet}`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user