Lines Matching refs:buf
104 static int read_uint(const uint8_t **buf, size_t *len, uint64_t **res) in read_uint() argument
114 **res = (uint64_t) **buf; in read_uint()
116 *buf += sizeof(uint64_t); in read_uint()
122 static int read_int(const uint8_t **buf, size_t *len, int64_t **res) in read_int() argument
132 **res = (int64_t) **buf; in read_int()
134 *buf += sizeof(int64_t); in read_int()
140 static int read_double(const uint8_t **buf, size_t *len, double **res) in read_double() argument
150 **res = (double) **buf; in read_double()
152 *buf += sizeof(double); in read_double()
158 static int read_utf8_string(const uint8_t **buf, size_t *len, char **res) in read_utf8_string() argument
163 found_len = OPENSSL_strnlen((const char *) *buf, *len); in read_utf8_string()
174 *res = (char *) *buf; in read_utf8_string()
176 *buf = *buf + found_len; /* continue after the \0 byte */ in read_utf8_string()
181 static int read_utf8_ptr(const uint8_t **buf, size_t *len, char **res) in read_utf8_ptr() argument
183 if (*len > 0 && **buf == 0xFF) { in read_utf8_ptr()
186 *buf += 1; in read_utf8_ptr()
190 return read_utf8_string(buf, len, res); in read_utf8_ptr()
193 static int read_octet_string(const uint8_t **buf, size_t *len, char **res) in read_octet_string() argument
197 const uint8_t *ptr = *buf; in read_octet_string()
215 *res = (char *) *buf; in read_octet_string()
217 r = ptr - *buf; in read_octet_string()
219 *buf = ptr; in read_octet_string()
225 static int read_octet_ptr(const uint8_t **buf, size_t *len, char **res) in read_octet_ptr() argument
228 if (*len > 1 && **buf == 0xFF && *(*buf + 1) == 0xFF) { in read_octet_ptr()
231 *buf += 2; in read_octet_ptr()
235 return read_octet_string(buf, len, res); in read_octet_ptr()
264 static OSSL_PARAM *fuzz_params(OSSL_PARAM *param, const uint8_t **buf, size_t *len) in fuzz_params() argument
288 if (!read_int(buf, len, &use_param)) { in fuzz_params()
307 } else if (!*use_param || !read_int(buf, len, &p_value_int)) { in fuzz_params()
329 } else if (!*use_param || !read_uint(buf, len, &p_value_uint)) { in fuzz_params()
339 if (!*use_param || !read_double(buf, len, &p_value_double)) { in fuzz_params()
349 if (*use_param && (data_len = read_utf8_string(buf, len, &p_value_utf8_str)) < 0) in fuzz_params()
357 if (*use_param && (data_len = read_octet_string(buf, len, &p_value_octet_str)) < 0) in fuzz_params()
365 if (*use_param && (data_len = read_utf8_ptr(buf, len, &p_value_utf8_ptr)) < 0) in fuzz_params()
373 if (*use_param && (data_len = read_octet_ptr(buf, len, &p_value_octet_ptr)) < 0) in fuzz_params()
465 unsigned char buf[4096]; in do_evp_mac() local
485 if (!EVP_MAC_final(ctx, buf, &final_l, sizeof(buf))) { in do_evp_mac()
499 unsigned char buf[4096]; in do_evp_rand() local
511 if (!EVP_RAND_generate(ctx, buf, sizeof(buf), 0, 0, NULL, 0)) { in do_evp_rand()
588 fuzzed_params = fuzz_params((OSSL_PARAM*) evp##_settable_ctx_params(alg), &buf, &len); \
595 int FuzzerTestOneInput(const uint8_t *buf, size_t len) in FuzzerTestOneInput() argument
601 if (!read_uint(&buf, &len, &operation)) { in FuzzerTestOneInput()
606 if (!read_int(&buf, &len, &algorithm)) { in FuzzerTestOneInput()