1
0
mirror of https://github.com/coturn/coturn.git synced 2025-10-24 04:20:59 +02:00
coturn/fuzzing/FuzzStun.c
Gustavo Garcia d9108a4b54
Add clang format rules and checks (#935)
I would like to get feedback on this and see if people is confortable
with these clang rules.

Right now is using the "llvm" style increasing the line length from 80
to 120 given that coturn is using long lines often.

Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
2022-11-06 22:05:17 +01:00

31 lines
783 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "apputils.h"
#include "ns_turn_utils.h"
#include "stun_buffer.h"
static SHATYPE shatype = SHATYPE_SHA1;
#define kMinInputLength 10
#define kMaxInputLength 5120
extern int LLVMFuzzerTestOneInput(const uint8_t *Data,
size_t Size) { // rfc5769check
if (Size < kMinInputLength || Size > kMaxInputLength) {
return 1;
}
stun_is_command_message_full_check_str((uint8_t *)Data, Size, 1, NULL);
uint8_t uname[33];
uint8_t realm[33];
uint8_t upwd[33];
strcpy((char *)upwd, "VOkJxbRl1RmTxUk/WvJxBt");
stun_check_message_integrity_str(TURN_CREDENTIALS_SHORT_TERM, (uint8_t *)Data,
Size, uname, realm, upwd, shatype);
return 0;
}