-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathtests.cpp
83 lines (65 loc) · 1.99 KB
/
tests.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include "tests.h"
#include <fuzzing/datasource/id.hpp>
namespace cryptofuzz {
namespace tests {
void test(const operation::Digest& op, const std::optional<component::Digest>& result) {
(void)op;
(void)result;
}
void test(const operation::HMAC& op, const std::optional<component::MAC>& result) {
(void)op;
(void)result;
}
static void test_ChaCha20_Poly1305_IV(const operation::SymmetricEncrypt& op, const std::optional<component::Ciphertext>& result) {
using fuzzing::datasource::ID;
/*
* OpenSSL CVE-2019-1543
* https://www.openssl.org/news/secadv/20190306.txt
*/
if ( op.cipher.cipherType.Get() != ID("Cryptofuzz/Cipher/CHACHA20_POLY1305") ) {
return;
}
if ( result == std::nullopt ) {
return;
}
if ( op.cipher.iv.GetSize() > 12 ) {
abort();
}
}
void test(const operation::SymmetricEncrypt& op, const std::optional<component::Ciphertext>& result) {
test_ChaCha20_Poly1305_IV(op, result);
}
void test(const operation::SymmetricDecrypt& op, const std::optional<component::Cleartext>& result) {
(void)op;
(void)result;
}
void test(const operation::CMAC& op, const std::optional<component::MAC>& result) {
(void)op;
(void)result;
}
void test(const operation::KDF_SCRYPT& op, const std::optional<component::Key>& result) {
(void)op;
(void)result;
}
void test(const operation::KDF_HKDF& op, const std::optional<component::Key>& result) {
(void)op;
(void)result;
}
void test(const operation::KDF_TLS1_PRF& op, const std::optional<component::Key>& result) {
(void)op;
(void)result;
}
void test(const operation::KDF_PBKDF2& op, const std::optional<component::Key>& result) {
(void)op;
(void)result;
}
void test(const operation::Sign& op, const std::optional<component::Signature>& result) {
(void)op;
(void)result;
}
void test(const operation::Verify& op, const std::optional<bool>& result) {
(void)op;
(void)result;
}
} /* namespace tests */
} /* namespace cryptofuzz */