-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneuter_crypto.patch
83 lines (75 loc) · 2.71 KB
/
neuter_crypto.patch
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
diff --git a/src/lib/cert/x509/x509_obj.cpp b/src/lib/cert/x509/x509_obj.cpp
index e908e8c..93bd62d 100644
--- a/src/lib/cert/x509/x509_obj.cpp
+++ b/src/lib/cert/x509/x509_obj.cpp
@@ -197,9 +197,13 @@ bool X509_Object::check_signature(const Public_Key& pub_key) const
Signature_Format format =
(pub_key.message_parts() >= 2) ? DER_SEQUENCE : IEEE_1363;
+#if 0
PK_Verifier verifier(pub_key, padding, format);
return verifier.verify_message(tbs_data(), signature());
+#else
+ return true;
+#endif
}
catch(std::exception&)
{
diff --git a/src/lib/pubkey/rsa/rsa.cpp b/src/lib/pubkey/rsa/rsa.cpp
index 57fab94..205e94c 100644
--- a/src/lib/pubkey/rsa/rsa.cpp
+++ b/src/lib/pubkey/rsa/rsa.cpp
@@ -49,6 +49,8 @@ RSA_PrivateKey::RSA_PrivateKey(RandomNumberGenerator& rng,
*/
bool RSA_PrivateKey::check_key(RandomNumberGenerator& rng, bool strong) const
{
+ return true;
+
if(!IF_Scheme_PrivateKey::check_key(rng, strong))
return false;
diff --git a/src/lib/tls/msg_cert_verify.cpp b/src/lib/tls/msg_cert_verify.cpp
index be6c8a0..58f9a93 100644
--- a/src/lib/tls/msg_cert_verify.cpp
+++ b/src/lib/tls/msg_cert_verify.cpp
@@ -84,9 +84,13 @@ bool Certificate_Verify::verify(const X509_Certificate& cert,
std::pair<std::string, Signature_Format> format =
state.understand_sig_format(*key.get(), m_hash_algo, m_sig_algo);
+#if 0
PK_Verifier verifier(*key, format.first, format.second);
return verifier.verify_message(state.hash().get_contents(), m_signature);
+#else
+ return true;
+#endif
}
}
diff --git a/src/lib/tls/msg_finished.cpp b/src/lib/tls/msg_finished.cpp
index b837172..69a316f 100644
--- a/src/lib/tls/msg_finished.cpp
+++ b/src/lib/tls/msg_finished.cpp
@@ -76,7 +76,11 @@ Finished::Finished(const std::vector<byte>& buf)
bool Finished::verify(const Handshake_State& state,
Connection_Side side) const
{
+#if 0
return (m_verification_data == finished_compute_verify(state, side));
+#else
+ return finished_compute_verify(state, side).size() == m_verification_data.size();
+#endif
}
}
diff --git a/src/lib/tls/tls_client.cpp b/src/lib/tls/tls_client.cpp
index 623a522..00c033f 100644
--- a/src/lib/tls/tls_client.cpp
+++ b/src/lib/tls/tls_client.cpp
@@ -394,11 +394,13 @@ void Client::process_handshake_msg(const Handshake_State* active_state,
{
const Public_Key& server_key = state.get_server_public_Key();
+#if 0
if(!state.server_kex()->verify(server_key, state))
{
throw TLS_Exception(Alert::DECRYPT_ERROR,
"Bad signature on server key exchange");
}
+#endif
}
}
else if(type == CERTIFICATE_REQUEST)