Home
last modified time | relevance | path

Searched refs:fdp (Results 1 – 10 of 10) sorted by relevance

/system/core/init/fuzzer/
Dinit_ueventHandler_fuzzer.cpp36 void MakeFile(FuzzedDataProvider* fdp, std::string s) { in MakeFile() argument
39 for (int32_t idx = 0; idx < fdp->ConsumeIntegralInRange(kMinSize, kMaxSize); ++idx) { in MakeFile()
40 out << fdp->ConsumeRandomLengthString(kMaxBytes) << "\n"; in MakeFile()
45 void CreateDir(std::string Directory, FuzzedDataProvider* fdp) { in CreateDir() argument
49 MakeFile(fdp, tmp + "/data"); in CreateDir()
50 MakeFile(fdp, tmp + "/loading"); in CreateDir()
53 std::string SelectRandomString(FuzzedDataProvider* fdp, std::string s) { in SelectRandomString() argument
54 if (fdp->ConsumeBool()) { in SelectRandomString()
55 if (fdp->ConsumeBool()) { in SelectRandomString()
56 return fdp->ConsumeRandomLengthString(kMaxBytes); in SelectRandomString()
[all …]
/system/keymaster/tests/fuzzers/
Dbuffer_fuzz.cpp36 [](keymaster::Buffer* buf, FuzzedDataProvider* fdp) -> void { in __anonabb7c61f0302()
37 buf->reserve(fdp->ConsumeIntegralInRange<int>(kMinBufferSize, kMaxBufferSize)); in __anonabb7c61f0302()
39 [](keymaster::Buffer* buf, FuzzedDataProvider* fdp) -> void { in __anonabb7c61f0402()
40 buf->advance_write(fdp->ConsumeIntegral<int>()); in __anonabb7c61f0402()
42 [](keymaster::Buffer* buf, FuzzedDataProvider* fdp) -> void { in __anonabb7c61f0502()
43 buf->Reinitialize(fdp->ConsumeIntegralInRange<size_t>(kMinBufferSize, kMaxBufferSize)); in __anonabb7c61f0502()
45 [](keymaster::Buffer* buf, FuzzedDataProvider* fdp) -> void { in __anonabb7c61f0602()
46 size_t buf_size = fdp->ConsumeIntegralInRange<size_t>(kMinBufferSize, kMaxBufferSize); in __anonabb7c61f0602()
50 [](keymaster::Buffer* buf, FuzzedDataProvider* fdp) -> void { in __anonabb7c61f0702()
51 uint16_t buf_size = fdp->ConsumeIntegralInRange<uint16_t>(kMinBufferSize, kMaxBufferSize); in __anonabb7c61f0702()
[all …]
Dmessage_serializable_fuzz.cpp28 void RunDeserialize(keymaster::Serializable* ser, FuzzedDataProvider* fdp) { in RunDeserialize() argument
29 uint16_t buf_size = fdp->ConsumeIntegralInRange<uint16_t>(kMinBufferSize, kMaxBufferSize); in RunDeserialize()
33 int32_t end = fdp->ConsumeIntegralInRange<int32_t>(0, buf_size); in RunDeserialize()
37 void RunSerialize(keymaster::Serializable* ser, FuzzedDataProvider* fdp) { in RunSerialize() argument
41 int32_t end = fdp->ConsumeIntegralInRange<int32_t>(0, buf_size); in RunSerialize()
46 FuzzedDataProvider fdp(data, size); in LLVMFuzzerTestOneInput() local
48 keymaster::getSerializable(fdp.ConsumeEnum<keymaster::SerializableType>()); in LLVMFuzzerTestOneInput()
52 for (size_t i = 0; fdp.remaining_bytes() > 0; i++) { in LLVMFuzzerTestOneInput()
53 if (fdp.ConsumeBool()) { in LLVMFuzzerTestOneInput()
54 RunSerialize(serializable.get(), &fdp); in LLVMFuzzerTestOneInput()
[all …]
/system/libfmq/fuzzer/
Dfmq_fuzzer.cpp125 FuzzedDataProvider fdp(&readerData[0], readerData.size()); in reader() local
127 while (fdp.remaining_bytes()) { in reader()
129 size_t numElements = fdp.ConsumeIntegralInRange<size_t>(0, kMaxNumElements); in reader()
139 if (fdp.ConsumeIntegral<uint8_t>() == 1) { in reader()
142 *writeCounter = fdp.ConsumeIntegral<uint64_t>(); in reader()
161 FuzzedDataProvider fdp(&readerData[0], readerData.size()); in readerBlocking() local
163 size_t count = fdp.remaining_bytes() in readerBlocking()
164 ? fdp.ConsumeIntegralInRange<size_t>(0, readMq.getQuantumCount() + 1) in readerBlocking()
169 } while (fdp.remaining_bytes() > sizeof(size_t) && writersNotFinished > 0); in readerBlocking()
183 void writer(const Desc& desc, Queue& writeMq, FuzzedDataProvider& fdp, bool userFd) { in writer() argument
[all …]
/system/security/keystore/tests/fuzzer/
DkeystoreGetWifiHidl_fuzzer.cpp36 FuzzedDataProvider fdp = FuzzedDataProvider(data, size); in LLVMFuzzerTestOneInput() local
37 size_t keyLength = fdp.ConsumeIntegralInRange<size_t>(0, kMaxKeySize); in LLVMFuzzerTestOneInput()
38 bool usePrefix = fdp.ConsumeBool(); in LLVMFuzzerTestOneInput()
41 size_t strKeySuffixLength = min(fdp.remaining_bytes(), keyLength); in LLVMFuzzerTestOneInput()
43 strKeyPrefix = fdp.PickValueInArray(kValidStrKeyPrefix); in LLVMFuzzerTestOneInput()
49 fdp.ConsumeBool() ? string(kStrKeySuffix) : fdp.ConsumeBytesAsString(strKeySuffixLength); in LLVMFuzzerTestOneInput()
52 if (fdp.ConsumeBool()) { in LLVMFuzzerTestOneInput()
53 uint64_t grant = fdp.ConsumeIntegral<uint64_t>(); in LLVMFuzzerTestOneInput()
DkeystoreCommon.h51 inline vector<uint8_t> initSignatureData(FuzzedDataProvider* fdp) { in initSignatureData() argument
52 size_t signatureSize = fdp->ConsumeIntegralInRange(kSignatureSizeMin, kSignatureSizeMax); in initSignatureData()
53 vector<uint8_t> signatureData = fdp->ConsumeBytes<uint8_t>(signatureSize); in initSignatureData()
57 inline PackageInfoData initPackageInfoData(FuzzedDataProvider* fdp) { in initPackageInfoData() argument
59 packageInfoData.packageName = fdp->ConsumeRandomLengthString(kRandomStringLength); in initPackageInfoData()
60 packageInfoData.versionCode = fdp->ConsumeIntegral<int64_t>(); in initPackageInfoData()
62 fdp->ConsumeIntegralInRange(kSignatureVectorSizeMin, kSignatureVectorSizeMax); in initPackageInfoData()
65 bool shouldUseParameterizedConstructor = fdp->ConsumeBool(); in initPackageInfoData()
67 vector<uint8_t> signatureData = initSignatureData(fdp); in initPackageInfoData()
DkeystoreAttestationId_fuzzer.cpp22 FuzzedDataProvider fdp = FuzzedDataProvider(data, size); in LLVMFuzzerTestOneInput() local
23 uint32_t uid = fdp.ConsumeIntegral<uint32_t>(); in LLVMFuzzerTestOneInput()
/system/chre/chpp/test/fuzz/
Dchpp_wifi_scan_param_fuzzer.cpp26 FuzzedDataProvider fdp(data, size); in LLVMFuzzerTestOneInput() local
29 params.scanType = fdp.ConsumeIntegral<uint8_t>(); in LLVMFuzzerTestOneInput()
30 params.maxScanAgeMs = fdp.ConsumeIntegral<uint32_t>(); in LLVMFuzzerTestOneInput()
32 std::vector<uint8_t> frequencyList = fdp.ConsumeBytes<uint8_t>( in LLVMFuzzerTestOneInput()
36 params.ssidListLen = fdp.ConsumeIntegral<uint8_t>(); in LLVMFuzzerTestOneInput()
40 item.ssidLen = fdp.ConsumeIntegral<uint8_t>(); in LLVMFuzzerTestOneInput()
41 fdp.ConsumeData(item.ssid, item.ssidLen); in LLVMFuzzerTestOneInput()
44 params.radioChainPref = fdp.ConsumeIntegral<uint8_t>(); in LLVMFuzzerTestOneInput()
45 params.channelSet = fdp.ConsumeIntegral<uint8_t>(); in LLVMFuzzerTestOneInput()
/system/core/fs_mgr/fuzz/
Dfs_mgr_fstab_fuzzer.cpp24 FuzzedDataProvider fdp(data, size); in LLVMFuzzerTestOneInput() local
26 std::string make_fstab_str = fdp.ConsumeRandomLengthString(); in LLVMFuzzerTestOneInput()
27 std::string dsu_slot = fdp.ConsumeRandomLengthString(30); in LLVMFuzzerTestOneInput()
29 fdp.ConsumeRandomLengthString(30), in LLVMFuzzerTestOneInput()
30 fdp.ConsumeRandomLengthString(30), in LLVMFuzzerTestOneInput()
32 std::string skip_mount_config = fdp.ConsumeRemainingBytesAsString(); in LLVMFuzzerTestOneInput()
/system/keymaster/fuzzer/
Dk4_keymaster_configuration_fuzzer.cpp24 FuzzedDataProvider fdp(data, size); in LLVMFuzzerTestOneInput() local
25 keymaster::GetOsVersion(fdp.ConsumeRandomLengthString(kMaxCharacters).c_str()); in LLVMFuzzerTestOneInput()
26 keymaster::GetOsPatchlevel(fdp.ConsumeRandomLengthString(kMaxCharacters).c_str()); in LLVMFuzzerTestOneInput()