summaryrefslogtreecommitdiffstats
path: root/crypto/self_test_core.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-09-02 09:08:09 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-09-18 06:20:33 +1000
commit7f9e74403677a995ded00f070d84297401f6e3fd (patch)
treea8eb5cc00e8ca3ae7e4c5e82263430ba12675d3a /crypto/self_test_core.c
parent4b51903d8681c7fd429c566548529d5753e24f47 (diff)
Add selftest callback to CRNG output test
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12795)
Diffstat (limited to 'crypto/self_test_core.c')
-rw-r--r--crypto/self_test_core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/self_test_core.c b/crypto/self_test_core.c
index 1a6f828c1d..ca8925abe5 100644
--- a/crypto/self_test_core.c
+++ b/crypto/self_test_core.c
@@ -157,12 +157,15 @@ void OSSL_SELF_TEST_onend(OSSL_SELF_TEST *st, int ret)
* is modified (corrupted). This is used to modify output signatures or
* ciphertext before they are verified or decrypted.
*/
-void OSSL_SELF_TEST_oncorrupt_byte(OSSL_SELF_TEST *st, unsigned char *bytes)
+int OSSL_SELF_TEST_oncorrupt_byte(OSSL_SELF_TEST *st, unsigned char *bytes)
{
if (st != NULL && st->cb != NULL) {
st->phase = OSSL_SELF_TEST_PHASE_CORRUPT;
self_test_setparams(st);
- if (!st->cb(st->params, st->cb_arg))
+ if (!st->cb(st->params, st->cb_arg)) {
bytes[0] ^= 1;
+ return 1;
+ }
}
+ return 0;
}