From 75073d0a8478441cc97a6efa10b566c5fb1dac81 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 17 Apr 2020 20:57:17 +0100 Subject: New upstream version 1.4.0 --- fuzz/wrap.c | 132 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 131 insertions(+), 1 deletion(-) (limited to 'fuzz/wrap.c') diff --git a/fuzz/wrap.c b/fuzz/wrap.c index 8ff7ee7..c030231 100644 --- a/fuzz/wrap.c +++ b/fuzz/wrap.c @@ -18,6 +18,8 @@ #include "mutator_aux.h" +extern int prng_up; + /* * Build wrappers around functions of interest, and have them fail * in a pseudo-random manner. @@ -27,7 +29,7 @@ extern type __wrap_##name args; \ extern type __real_##name args; \ type __wrap_##name args { \ - if (uniform_random(400) < (prob)) { \ + if (prng_up && uniform_random(400) < (prob)) { \ return (retval); \ } \ \ @@ -141,6 +143,22 @@ WRAP(RSA *, 1 ) +WRAP(EC_KEY *, + EVP_PKEY_get0_EC_KEY, + (EVP_PKEY *pkey), + NULL, + (pkey), + 1 +) + +WRAP(int, + EVP_PKEY_get_raw_public_key, + (const EVP_PKEY *pkey, unsigned char *pub, size_t *len), + 0, + (pkey, pub, len), + 1 +) + WRAP(EVP_MD_CTX *, EVP_MD_CTX_new, (void), @@ -166,6 +184,14 @@ WRAP(BIGNUM *, 1 ) +WRAP(int, + BN_bn2bin, + (const BIGNUM *a, unsigned char *to), + -1, + (a, to), + 1 +) + WRAP(BIGNUM *, BN_CTX_get, (BN_CTX *ctx), @@ -214,6 +240,14 @@ WRAP(const EC_GROUP *, 1 ) +WRAP(const BIGNUM *, + EC_KEY_get0_private_key, + (const EC_KEY *key), + NULL, + (key), + 1 +) + WRAP(EC_POINT *, EC_POINT_new, (const EC_GROUP *group), @@ -222,6 +256,14 @@ WRAP(EC_POINT *, 1 ) +WRAP(int, + EC_POINT_get_affine_coordinates_GFp, + (const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx), + 0, + (group, p, x, y, ctx), + 1 +) + WRAP(EVP_PKEY *, EVP_PKEY_new, (void), @@ -238,6 +280,38 @@ WRAP(int, 1 ) +WRAP(int, + EVP_PKEY_keygen_init, + (EVP_PKEY_CTX *ctx), + 0, + (ctx), + 1 +) + +WRAP(int, + EVP_PKEY_keygen, + (EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey), + 0, + (ctx, ppkey), + 1 +) + +WRAP(int, + EVP_PKEY_paramgen_init, + (EVP_PKEY_CTX *ctx), + 0, + (ctx), + 1 +) + +WRAP(int, + EVP_PKEY_paramgen, + (EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey), + 0, + (ctx, ppkey), + 1 +) + WRAP(EVP_PKEY *, EVP_PKEY_new_raw_public_key, (int type, ENGINE *e, const unsigned char *key, size_t keylen), @@ -254,6 +328,14 @@ WRAP(EVP_PKEY_CTX *, 1 ) +WRAP(EVP_PKEY_CTX *, + EVP_PKEY_CTX_new_id, + (int id, ENGINE *e), + NULL, + (id, e), + 1 +) + WRAP(int, EVP_PKEY_derive_init, (EVP_PKEY_CTX *ctx), @@ -345,6 +427,30 @@ WRAP(cbor_item_t *, 1 ) +WRAP(cbor_item_t *, + cbor_build_bool, + (bool value), + NULL, + (value), + 1 +) + +WRAP(cbor_item_t *, + cbor_build_negint8, + (uint8_t value), + NULL, + (value), + 1 +) + +WRAP(cbor_item_t *, + cbor_build_negint16, + (uint16_t value), + NULL, + (value), + 1 +) + WRAP(cbor_item_t *, cbor_load, (cbor_data source, size_t source_size, struct cbor_load_result *result), @@ -361,6 +467,14 @@ WRAP(cbor_item_t *, 1 ) +WRAP(cbor_item_t *, + cbor_build_uint32, + (uint32_t value), + NULL, + (value), + 1 +) + WRAP(struct cbor_pair *, cbor_map_handle, (const cbor_item_t *item), @@ -377,6 +491,14 @@ WRAP(cbor_item_t **, 1 ) +WRAP(bool, + cbor_array_push, + (cbor_item_t *array, cbor_item_t *pushee), + false, + (array, pushee), + 1 +) + WRAP(bool, cbor_map_add, (cbor_item_t *item, struct cbor_pair pair), @@ -393,6 +515,14 @@ WRAP(cbor_item_t *, 1 ) +WRAP(cbor_item_t *, + cbor_new_definite_array, + (size_t size), + NULL, + (size), + 1 +) + WRAP(size_t, cbor_serialize_alloc, (const cbor_item_t *item, cbor_mutable_data *buffer, -- cgit v1.2.3