Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
orbea
Tor
Commits
2d0e1cef
Commit
2d0e1cef
authored
6 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Add fuzzing wrapper for fetch_from_buf_socks()
parent
75569335
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
scripts/codegen/fuzzing_include_am.py
+1
-0
1 addition, 0 deletions
scripts/codegen/fuzzing_include_am.py
src/test/fuzz/fuzz_socks.c
+50
-0
50 additions, 0 deletions
src/test/fuzz/fuzz_socks.c
src/test/fuzz/include.am
+24
-1
24 additions, 1 deletion
src/test/fuzz/include.am
with
75 additions
and
1 deletion
scripts/codegen/fuzzing_include_am.py
+
1
−
0
View file @
2d0e1cef
...
...
@@ -12,6 +12,7 @@ FUZZERS = """
http-connect
iptsv2
microdesc
socks
vrs
"""
...
...
This diff is collapsed.
Click to expand it.
src/test/fuzz/fuzz_socks.c
0 → 100644
+
50
−
0
View file @
2d0e1cef
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#include
"orconfig.h"
#define BUFFERS_PRIVATE
#include
"core/or/or.h"
#include
"lib/container/buffers.h"
#include
"lib/err/backtrace.h"
#include
"lib/log/log.h"
#include
"core/proto/proto_socks.h"
#include
"feature/client/addressmap.h"
#include
"test/fuzz/fuzzing.h"
int
fuzz_init
(
void
)
{
addressmap_init
();
return
0
;
}
int
fuzz_cleanup
(
void
)
{
addressmap_free_all
();
return
0
;
}
int
fuzz_main
(
const
uint8_t
*
stdin_buf
,
size_t
data_size
)
{
buf_t
*
buffer
=
buf_new_with_data
((
char
*
)
stdin_buf
,
data_size
);
if
(
!
buffer
)
{
tor_assert
(
data_size
==
0
);
buffer
=
buf_new
();
}
socks_request_t
*
request
=
socks_request_new
();
int
r
=
fetch_from_buf_socks
(
buffer
,
request
,
0
,
0
);
log_info
(
LD_GENERAL
,
"Socks request status: %d"
,
r
);
/* Reset. */
buf_free
(
buffer
);
socks_request_free
(
request
);
return
0
;
}
This diff is collapsed.
Click to expand it.
src/test/fuzz/include.am
+
24
−
1
View file @
2d0e1cef
...
...
@@ -17,7 +17,7 @@ FUZZING_LIBS = \
@TOR_ZSTD_LIBS@
oss-fuzz-prereqs: \
$(TOR_INTERNAL_TESTING_LIBS)
$(TOR_INTERNAL_TESTING_LIBS)
noinst_HEADERS += \
src/test/fuzz/fuzzing.h
...
...
@@ -120,6 +120,14 @@ src_test_fuzz_fuzz_microdesc_CFLAGS = $(FUZZING_CFLAGS)
src_test_fuzz_fuzz_microdesc_LDFLAGS = $(FUZZING_LDFLAG)
src_test_fuzz_fuzz_microdesc_LDADD = $(FUZZING_LIBS)
src_test_fuzz_fuzz_socks_SOURCES = \
src/test/fuzz/fuzzing_common.c \
src/test/fuzz/fuzz_socks.c
src_test_fuzz_fuzz_socks_CPPFLAGS = $(FUZZING_CPPFLAGS)
src_test_fuzz_fuzz_socks_CFLAGS = $(FUZZING_CFLAGS)
src_test_fuzz_fuzz_socks_LDFLAGS = $(FUZZING_LDFLAG)
src_test_fuzz_fuzz_socks_LDADD = $(FUZZING_LIBS)
src_test_fuzz_fuzz_vrs_SOURCES = \
src/test/fuzz/fuzzing_common.c \
src/test/fuzz/fuzz_vrs.c
...
...
@@ -140,6 +148,7 @@ FUZZERS = \
src/test/fuzz/fuzz-http-connect \
src/test/fuzz/fuzz-iptsv2 \
src/test/fuzz/fuzz-microdesc \
src/test/fuzz/fuzz-socks \
src/test/fuzz/fuzz-vrs
# ===== libfuzzer
...
...
@@ -222,6 +231,13 @@ src_test_fuzz_lf_fuzz_microdesc_CFLAGS = $(LIBFUZZER_CFLAGS)
src_test_fuzz_lf_fuzz_microdesc_LDFLAGS = $(LIBFUZZER_LDFLAG)
src_test_fuzz_lf_fuzz_microdesc_LDADD = $(LIBFUZZER_LIBS)
src_test_fuzz_lf_fuzz_socks_SOURCES = \
$(src_test_fuzz_fuzz_socks_SOURCES)
src_test_fuzz_lf_fuzz_socks_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
src_test_fuzz_lf_fuzz_socks_CFLAGS = $(LIBFUZZER_CFLAGS)
src_test_fuzz_lf_fuzz_socks_LDFLAGS = $(LIBFUZZER_LDFLAG)
src_test_fuzz_lf_fuzz_socks_LDADD = $(LIBFUZZER_LIBS)
src_test_fuzz_lf_fuzz_vrs_SOURCES = \
$(src_test_fuzz_fuzz_vrs_SOURCES)
src_test_fuzz_lf_fuzz_vrs_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
...
...
@@ -241,6 +257,7 @@ LIBFUZZER_FUZZERS = \
src/test/fuzz/lf-fuzz-http-connect \
src/test/fuzz/lf-fuzz-iptsv2 \
src/test/fuzz/lf-fuzz-microdesc \
src/test/fuzz/lf-fuzz-socks \
src/test/fuzz/lf-fuzz-vrs
else
...
...
@@ -305,6 +322,11 @@ src_test_fuzz_liboss_fuzz_microdesc_a_SOURCES = \
src_test_fuzz_liboss_fuzz_microdesc_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
src_test_fuzz_liboss_fuzz_microdesc_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
src_test_fuzz_liboss_fuzz_socks_a_SOURCES = \
$(src_test_fuzz_fuzz_socks_SOURCES)
src_test_fuzz_liboss_fuzz_socks_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
src_test_fuzz_liboss_fuzz_socks_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
src_test_fuzz_liboss_fuzz_vrs_a_SOURCES = \
$(src_test_fuzz_fuzz_vrs_SOURCES)
src_test_fuzz_liboss_fuzz_vrs_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
...
...
@@ -322,6 +344,7 @@ OSS_FUZZ_FUZZERS = \
src/test/fuzz/liboss-fuzz-http-connect.a \
src/test/fuzz/liboss-fuzz-iptsv2.a \
src/test/fuzz/liboss-fuzz-microdesc.a \
src/test/fuzz/liboss-fuzz-socks.a \
src/test/fuzz/liboss-fuzz-vrs.a
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment