2 Fuzzing sess_*crypt_blob
3 Copyright (C) Catalyst IT 2020
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include "fuzzing/fuzzing.h"
20 #include "libcli/auth/libcli_auth.h"
23 int LLVMFuzzerInitialize(int *argc
, char ***argv
)
29 int LLVMFuzzerTestOneInput(const uint8_t *input
, size_t len
)
31 TALLOC_CTX
*mem_ctx
= NULL
;
32 DATA_BLOB blob
, session_key
, out
;
43 session_key
.data
= input
+ 1;
44 session_key
.length
= slen
;
45 blob
.data
= input
+ 1 + slen
;
46 blob
.length
= len
- slen
- 1;
48 mem_ctx
= talloc_new(NULL
);
50 out
= sess_encrypt_blob(mem_ctx
, &blob
, &session_key
);
51 sess_decrypt_blob(mem_ctx
, &blob
, &session_key
, &out
);