mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-11-24 14:35:51 +00:00
fix(fuzz): pass buffered to readBinary funcs
This commit is contained in:
parent
08cda81233
commit
02adea3962
@ -10,8 +10,8 @@ function ignoredError(error) {
|
|||||||
* @param { Buffer } inputData
|
* @param { Buffer } inputData
|
||||||
*/
|
*/
|
||||||
export function fuzz (inputData) {
|
export function fuzz (inputData) {
|
||||||
const binaryKey = new Uint8Array(`-----BEGIN PGP PRIVATE KEY BLOCK-----\n ${inputData.toString('base64')} -----END PGP PRIVATE KEY BLOCK-----`);
|
const binaryKey = new Uint8Array(inputData);
|
||||||
|
binaryKey[0] |= 0x80;
|
||||||
return readKey({ binaryKey })
|
return readKey({ binaryKey })
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (error.message && !ignoredError(error)) {
|
if (error.message && !ignoredError(error)) {
|
||||||
|
|||||||
@ -10,8 +10,8 @@ function ignoredError(error) {
|
|||||||
* @param { Buffer } inputData
|
* @param { Buffer } inputData
|
||||||
*/
|
*/
|
||||||
export function fuzz (inputData) {
|
export function fuzz (inputData) {
|
||||||
const binaryMessage = new Uint8Array(`-----BEGIN PGP MESSAGE-----\n ${inputData.toString('base64')} -----END PGP MESSAGE-----`);
|
const binaryMessage = new Uint8Array(inputData);
|
||||||
|
binaryMessage[0] |= 0x80;
|
||||||
return readMessage({ binaryMessage })
|
return readMessage({ binaryMessage })
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (error.message && !ignoredError(error)) {
|
if (error.message && !ignoredError(error)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user