Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
ba27341e
Commit
ba27341e
authored
Jun 10, 2021
by
Olivier Dion
Committed by
Adrien Béraud
Jun 29, 2021
Browse files
fuzzing: Add OpenDHt wrapper
Change-Id: I92e57a1f62e3bae67c8ae4ca6d7654dfe427c361
parent
836f4d7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/fuzzing/lib/dht.cpp
0 → 100644
View file @
ba27341e
/*
* Copyright (C) 2021 Savoir-faire Linux Inc.
*
* Author: Olivier Dion <olivier.dion>@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef WIP
#include
<opendht/dhtrunner.h>
#include
<opendht/thread_pool.h>
#include
<opendht/default_types.h>
namespace
dht
{
__weak
bool
mutate_dht_encrypted_ImMessage
(
ImMessage
&
msg
)
{
printf
(
"message!
\n
"
);
return
false
;
}
/* TODO - Is there a way to not tod without the mangled name? Use nm(1) for that. */
BEGIN_METHOD_WRAPPER
(
_ZN3dht9DhtRunner12putEncryptedENS_4HashILm20EEES2_St10shared_ptrINS_5ValueEESt8functionIFvbRKSt6vectorIS3_INS_4NodeEESaIS9_EEEEb
,
void
,
DhtRunner
::
putEncrypted
,
InfoHash
hash
,
InfoHash
to
,
std
::
shared_ptr
<
Value
>
value
,
DoneCallback
cb
,
bool
permanent
)
{
if
(
value
->
type
==
ImMessage
::
TYPE
.
id
)
{
ImMessage
uv
=
Value
::
unpack
<
ImMessage
>
(
value
);
bool
mutated
=
mutate_dht_encrypted_ImMessage
(
uv
);
}
this_func
(
this
,
hash
,
to
,
value
,
cb
,
permanent
);
}
END_WRAPPER
();
};
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment