File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
test/unit/test/sansio/handshake Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -43,4 +43,37 @@ BOOST_AUTO_TEST_CASE(empty_password)
43
43
44
44
BOOST_AUTO_TEST_SUITE_END ()
45
45
46
+ BOOST_AUTO_TEST_SUITE (test_handshake_csha2p_encrypt_password)
47
+
48
+ /* *
49
+ encrypt password success
50
+ success
51
+ success password is 20 bytes
52
+ success password is > 20 bytes
53
+ success password is max length
54
+ success password is > max length but key is longer than default max length
55
+ password is > 512 (small buffer)
56
+ digest is > 512 (small buffer)
57
+ error creating buffer (mock)
58
+ error loading key
59
+ buffer is empty
60
+ key is malformed
61
+ TODO: should we fuzz this function?
62
+ key is not RSA
63
+ key is smaller than what we expect?
64
+ determining the size of the hash
65
+ failure (EVP_PKEY_get_size < 0: mock)
66
+ not available (EVP_PKEY_get_size = 0: mock)
67
+ error creating ctx (mock)
68
+ error setting RSA padding (mock)
69
+ encrypting
70
+ the returned size is < buffer
71
+ the returned size is == buffer
72
+ the returned size is > buffer (mock)
73
+ encryption fails (probably merge with the one below)
74
+ password is too big for encryption (with 2 sizes)
75
+ */
76
+
77
+ BOOST_AUTO_TEST_SUITE_END ()
78
+
46
79
} // namespace
You can’t perform that action at this time.
0 commit comments