
Improve error handling in `RSA::parse_rsa_key` by using ASN1 macros and generalizing the parsing to both private and public keys.
17 lines
434 B
C++
17 lines
434 B
C++
/*
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibCrypto/PK/RSA.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
|
{
|
|
AK::set_debug_enabled(false);
|
|
(void)Crypto::PK::RSA::parse_rsa_key({ data, size }, true, {});
|
|
(void)Crypto::PK::RSA::parse_rsa_key({ data, size }, false, {});
|
|
return 0;
|
|
}
|