/src/coturn/fuzzing/FuzzStun.c
Line | Count | Source (jump to first uncovered line) |
1 | | #include <stdio.h> |
2 | | #include <stdlib.h> |
3 | | #include <string.h> |
4 | | |
5 | | #include "apputils.h" |
6 | | #include "ns_turn_utils.h" |
7 | | #include "stun_buffer.h" |
8 | | |
9 | | static SHATYPE shatype = SHATYPE_SHA1; |
10 | | |
11 | 0 | #define kMinInputLength 10 |
12 | 0 | #define kMaxInputLength 5120 |
13 | | |
14 | | extern int LLVMFuzzerTestOneInput(const uint8_t *Data, |
15 | 0 | size_t Size) { // rfc5769check |
16 | |
|
17 | 0 | if (Size < kMinInputLength || Size > kMaxInputLength) { |
18 | 0 | return 1; |
19 | 0 | } |
20 | | |
21 | 0 | stun_is_command_message_full_check_str((uint8_t *)Data, Size, 1, NULL); |
22 | |
|
23 | 0 | uint8_t uname[33]; |
24 | 0 | uint8_t realm[33]; |
25 | 0 | uint8_t upwd[33]; |
26 | 0 | strcpy((char *)upwd, "VOkJxbRl1RmTxUk/WvJxBt"); |
27 | 0 | stun_check_message_integrity_str(TURN_CREDENTIALS_SHORT_TERM, (uint8_t *)Data, Size, uname, realm, upwd, shatype); |
28 | 0 | return 0; |
29 | 0 | } |