mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-11-24 14:35:51 +00:00
16 lines
435 B
JavaScript
16 lines
435 B
JavaScript
const { FuzzedDataProvider } = require('@jazzer.js/core');
|
|
|
|
const MAX_MESSAGE_LENGTH = 9000;
|
|
/**
|
|
* @param { Buffer } inputData
|
|
*/
|
|
module.exports.fuzz = function(inputData) {
|
|
import('../initOpenpgp.js').then(openpgp => {
|
|
const data = new FuzzedDataProvider(inputData);
|
|
const text = data.bufToPrintableString(inputData, 2, MAX_MESSAGE_LENGTH, 'utf-8');
|
|
return openpgp.default.createCleartextMessage({ text });
|
|
});
|
|
|
|
};
|
|
|