1
0
mirror of https://github.com/coturn/coturn.git synced 2025-11-01 15:31:00 +01:00
coturn/fuzzing/FuzzStun.c
Arjun dda0c99759
fuzzing support (#982)
Adding fuzzing to finding memory-corruption-related bugs.

Hello coturn team,
Can you check this pr harness suite for creating harnesses and compiling
harnesses?
Any other thoughts on adding a new interface for fuzzing support ?


Signed-off-by: 0x34d <ajsinghyadav00@gmail.com>

Signed-off-by: 0x34d <ajsinghyadav00@gmail.com>
2022-10-24 22:01:58 +02:00

29 lines
732 B
C

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "ns_turn_utils.h"
#include "apputils.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;
}