Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: device/u2f/u2f_message_fuzzer.cc

Issue 2502103002: Add FIDO U2F message and packet classes (Closed)
Patch Set: Add basic fuzzer test, and updated constructor for U2fMessage to account for invalid packets Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/u2f/u2f_message_fuzzer.cc
diff --git a/device/u2f/u2f_message_fuzzer.cc b/device/u2f/u2f_message_fuzzer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..aecc614616ebf1e4315f5cde049b0c344973a6d6
--- /dev/null
+++ b/device/u2f/u2f_message_fuzzer.cc
@@ -0,0 +1,16 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <stddef.h>
+#include <stdint.h>
+#include "u2f_message.h"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ scoped_refptr<net::IOBufferWithSize> buf =
+ make_scoped_refptr(new net::IOBufferWithSize(size));
Reilly Grant (use Gerrit) 2016/12/10 00:02:44 scoped_refptr<net::IOBufferWithSize> buf( new
Casey Piper 2016/12/10 01:38:03 Done.
+ memcpy(buf->data(), data, size);
+ scoped_refptr<device::U2fMessage> msg =
+ device::U2fMessage::CreateFromSerializedData(buf);
+ return 0;
+}

Powered by Google App Engine
This is Rietveld 408576698