]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: EAP-pwd local failure in crypto_bignum_rand()
authorJouni Malinen <j@w1.fi>
Sat, 13 Apr 2019 14:00:55 +0000 (17:00 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 13 Apr 2019 15:28:05 +0000 (18:28 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
src/crypto/crypto_openssl.c
src/crypto/crypto_wolfssl.c
tests/hwsim/test_eap_proto.py

index 9672f711cd3e58a73577a9f6599989d310fe8e2a..27e68f739f439091ff6cbd1fbdb0d9579627f358 100644 (file)
@@ -1320,6 +1320,8 @@ int crypto_bignum_to_bin(const struct crypto_bignum *a,
 
 int crypto_bignum_rand(struct crypto_bignum *r, const struct crypto_bignum *m)
 {
+       if (TEST_FAIL())
+               return -1;
        return BN_rand_range((BIGNUM *) r, (const BIGNUM *) m) == 1 ? 0 : -1;
 }
 
index 07ad1aa4a104defe45d932d5ece8538da66612db..6b2ac8c433d51d65338a44bbdca3de80ee57e880 100644 (file)
@@ -1085,6 +1085,8 @@ int crypto_bignum_rand(struct crypto_bignum *r, const struct crypto_bignum *m)
        int ret = 0;
        WC_RNG rng;
 
+       if (TEST_FAIL())
+               return -1;
        if (wc_InitRng(&rng) != 0)
                return -1;
        if (mp_rand_prime((mp_int *) r,
index 235f73192a8b6013dbf8ddad0ecef92607464b16..e327b2f3507215918c7c22644636868f949240bd 100644 (file)
@@ -6794,6 +6794,7 @@ def test_eap_proto_pwd_errors(dev, apdev):
              (1, "crypto_bignum_to_bin;compute_password_element"),
              (1, "crypto_ec_point_compute_y_sqr;compute_password_element"),
              (1, "crypto_ec_point_solve_y_coord;compute_password_element"),
+             (1, "crypto_bignum_rand;compute_password_element"),
              (1, "crypto_bignum_sub;compute_password_element")]
     for count, func in funcs:
         with fail_test(dev[0], count, func):