Skip to content

Commit

Permalink
[test] enable srp adv
Browse files Browse the repository at this point in the history
  • Loading branch information
LuDuda committed May 26, 2024
1 parent e35fb6e commit 2aa84d1
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 3 deletions.
20 changes: 18 additions & 2 deletions src/cli/cli_tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ template <> otError TcpExample::Process<Cmd("init")>(Arg aArgs[])

// mbedtls_debug_set_threshold(0);

otPlatCryptoRandomInit();
//otPlatCryptoRandomInit();
mbedtls_x509_crt_init(&mSrvCert);
mbedtls_pk_init(&mPKey);

Expand Down Expand Up @@ -261,6 +261,23 @@ template <> otError TcpExample::Process<Cmd("init")>(Arg aArgs[])
mInitialized = true;

exit:
if (error != OT_ERROR_NONE)
{
#if OPENTHREAD_CONFIG_TLS_ENABLE
if (mUseTls)
{
mbedtls_ssl_config_free(&mSslConfig);
mbedtls_ssl_free(&mSslContext);

mbedtls_pk_free(&mPKey);
mbedtls_x509_crt_free(&mSrvCert);
}

otTcpCircularSendBufferForceDiscardAll(&mSendBuffer);
OT_UNUSED_VARIABLE(otTcpCircularSendBufferDeinitialize(&mSendBuffer));
#endif
}

return error;
}

Expand All @@ -286,7 +303,6 @@ template <> otError TcpExample::Process<Cmd("deinit")>(Arg aArgs[])
#if OPENTHREAD_CONFIG_TLS_ENABLE
if (mUseTls)
{
otPlatCryptoRandomDeinit();
mbedtls_ssl_config_free(&mSslConfig);
mbedtls_ssl_free(&mSslContext);

Expand Down
100 changes: 100 additions & 0 deletions tests/fuzz/fuzzer_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@
#include <openthread/platform/alarm-micro.h>
#include <openthread/platform/alarm-milli.h>
#include <openthread/platform/diag.h>
#include <openthread/platform/dnssd.h>
#include <openthread/platform/entropy.h>
#include <openthread/platform/logging.h>
#include <openthread/platform/mdns_socket.h>
#include <openthread/platform/misc.h>
#include <openthread/platform/multipan.h>
#include <openthread/platform/radio.h>
Expand Down Expand Up @@ -515,3 +517,101 @@ void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otErro
}

void otPlatDiagAlarmCallback(otInstance *aInstance) { OT_UNUSED_VARIABLE(aInstance); }

otPlatDnssdState otPlatDnssdGetState(otInstance *aInstance)
{
OT_UNUSED_VARIABLE(aInstance);

return OT_PLAT_DNSSD_STOPPED;
}

void otPlatDnssdRegisterService(otInstance *aInstance,
const otPlatDnssdService *aService,
otPlatDnssdRequestId aRequestId,
otPlatDnssdRegisterCallback aCallback)
{
OT_UNUSED_VARIABLE(aInstance);
OT_UNUSED_VARIABLE(aService);
OT_UNUSED_VARIABLE(aRequestId);
OT_UNUSED_VARIABLE(aCallback);
}

void otPlatDnssdUnregisterService(otInstance *aInstance,
const otPlatDnssdService *aService,
otPlatDnssdRequestId aRequestId,
otPlatDnssdRegisterCallback aCallback)
{
OT_UNUSED_VARIABLE(aInstance);
OT_UNUSED_VARIABLE(aService);
OT_UNUSED_VARIABLE(aRequestId);
OT_UNUSED_VARIABLE(aCallback);
}

void otPlatDnssdRegisterHost(otInstance *aInstance,
const otPlatDnssdHost *aHost,
otPlatDnssdRequestId aRequestId,
otPlatDnssdRegisterCallback aCallback)
{
OT_UNUSED_VARIABLE(aInstance);
OT_UNUSED_VARIABLE(aHost);
OT_UNUSED_VARIABLE(aRequestId);
OT_UNUSED_VARIABLE(aCallback);
}

void otPlatDnssdUnregisterHost(otInstance *aInstance,
const otPlatDnssdHost *aHost,
otPlatDnssdRequestId aRequestId,
otPlatDnssdRegisterCallback aCallback)
{
OT_UNUSED_VARIABLE(aInstance);
OT_UNUSED_VARIABLE(aHost);
OT_UNUSED_VARIABLE(aRequestId);
OT_UNUSED_VARIABLE(aCallback);
}

void otPlatDnssdRegisterKey(otInstance *aInstance,
const otPlatDnssdKey *aKey,
otPlatDnssdRequestId aRequestId,
otPlatDnssdRegisterCallback aCallback)
{
OT_UNUSED_VARIABLE(aInstance);
OT_UNUSED_VARIABLE(aKey);
OT_UNUSED_VARIABLE(aRequestId);
OT_UNUSED_VARIABLE(aCallback);
}

void otPlatDnssdUnregisterKey(otInstance *aInstance,
const otPlatDnssdKey *aKey,
otPlatDnssdRequestId aRequestId,
otPlatDnssdRegisterCallback aCallback)
{
OT_UNUSED_VARIABLE(aInstance);
OT_UNUSED_VARIABLE(aKey);
OT_UNUSED_VARIABLE(aRequestId);
OT_UNUSED_VARIABLE(aCallback);
}

otError otPlatMdnsSetListeningEnabled(otInstance *aInstance, bool aEnable, uint32_t aInfraIfIndex)
{
OT_UNUSED_VARIABLE(aInstance);
OT_UNUSED_VARIABLE(aEnable);
OT_UNUSED_VARIABLE(aInfraIfIndex);

return OT_ERROR_NOT_IMPLEMENTED;
}

void otPlatMdnsSendMulticast(otInstance *aInstance, otMessage *aMessage, uint32_t aInfraIfIndex)
{
OT_UNUSED_VARIABLE(aInstance);
OT_UNUSED_VARIABLE(aMessage);
OT_UNUSED_VARIABLE(aInfraIfIndex);
}

void otPlatMdnsSendUnicast(otInstance *aInstance,
otMessage *aMessage,
const otPlatMdnsAddressInfo *aAddress)
{
OT_UNUSED_VARIABLE(aInstance);
OT_UNUSED_VARIABLE(aMessage);
OT_UNUSED_VARIABLE(aAddress);
}
5 changes: 4 additions & 1 deletion tests/fuzz/oss-fuzz-build
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ set -euxo pipefail
-DOT_RCP=OFF \
-DOT_BORDER_AGENT=ON \
-DOT_BORDER_ROUTER=ON \
-DOT_BORDER_ROUTING=ON \
-DOT_CHANNEL_MANAGER=ON \
-DOT_CHANNEL_MONITOR=ON \
-DOT_COAP=ON \
Expand All @@ -55,6 +56,7 @@ set -euxo pipefail
-DOT_DHCP6_CLIENT=ON \
-DOT_DHCP6_SERVER=ON \
-DOT_DNS_CLIENT=ON \
-DOT_DNSSD_SERVER=ON \
-DOT_ECDSA=ON \
-DOT_HISTORY_TRACKER=ON \
-DOT_IP6_FRAGM=ON \
Expand All @@ -63,13 +65,14 @@ set -euxo pipefail
-DOT_LINK_RAW=ON \
-DOT_LOG_OUTPUT=APP \
-DOT_MAC_FILTER=ON \
-DOT_MDNS=ON \
-DOT_NETDATA_PUBLISHER=ON \
-DOT_NETDIAG_CLIENT=ON \
-DOT_PING_SENDER=ON \
-DOT_SERVICE=ON \
-DOT_SLAAC=ON \
-DOT_SNTP_CLIENT=ON \
-DOT_SRN_ADV_PROXY=ON \
-DOT_SRP_ADV_PROXY=ON \
-DOT_SRP_CLIENT=ON \
-DOT_SRP_SERVER=ON \
-DOT_TCP=ON \
Expand Down

0 comments on commit 2aa84d1

Please sign in to comment.