You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 29, 2024. It is now read-only.
Copy file name to clipboardexpand all lines: lib/TTLS/include/Module.h
+54
Original file line number
Diff line number
Diff line change
@@ -155,6 +155,13 @@ namespace eap
155
155
156
156
/// @}
157
157
158
+
///
159
+
/// Spawns a new certificate revocation check thread
160
+
///
161
+
/// \param[inout] cert Certificate context to check for revocation. `hCertStore` member should contain all certificates in chain up to and including root CA to test them for revocation too.
/// Checks all configured providers and tries to combine credentials.
@@ -195,6 +202,53 @@ namespace eap
195
202
BYTE *m_blob_cred; ///< Credentials BLOB
196
203
#endif
197
204
};
205
+
206
+
///
207
+
///< Post-festum server certificate revocation verify thread
208
+
///
209
+
classcrl_checker {
210
+
public:
211
+
///
212
+
/// Constructs a thread
213
+
///
214
+
/// \param[in ] mod EAP module to use for global services
215
+
/// \param[inout] cert Certificate context to check for revocation. `hCertStore` member should contain all certificates in chain up to and including root CA to test them for revocation too.
SECURITY_STATUS status = QueryContextAttributes(m_sc_ctx, SECPKG_ATTR_REMOTE_CERT_CONTEXT, (PVOID)&m_sc_cert);
557
+
if (FAILED(status))
558
+
throwsec_runtime_error(status, __FUNCTION__ " Error retrieving server certificate from Schannel.");
559
+
560
+
// Add all trusted root CAs to server certificate's store. This allows CertGetIssuerCertificateFromStore() in the following CRL check to test the root CA for revocation too.
561
+
// verify_server_trust(), ignores all self-signed certificates from the server certificate's store, and rebuilds its own trusted root store, so we are safe to do this.
562
+
for (auto c = m_cfg.m_trusted_root_ca.cbegin(), c_end = m_cfg.m_trusted_root_ca.cend(); c != c_end; ++c)
throwcom_runtime_error(CRYPT_E_REVOKED, __FUNCTION__ " Server certificate or one of its issuer's certificate has been found revoked as compromised. Your credentials were probably sent to this server during previous connection attempts, thus changing your credentials (in a safe manner) is strongly advised. Please, contact your helpdesk immediately.");
579
+
}
580
+
}
581
+
582
+
DWORD flags = 0;
583
+
c = CertGetIssuerCertificateFromStore(m_sc_cert->hCertStore, c, NULL, &flags);
584
+
if (!c) break;
585
+
}
586
+
}
587
+
552
588
#if EAP_TLS < EAP_TLS_SCHANNEL_FULL
553
-
if (status == SEC_E_OK)
589
+
// Verify server certificate chain.
554
590
verify_server_trust();
555
591
#endif
592
+
}
556
593
557
594
if (status == SEC_E_OK || status == SEC_I_CONTINUE_NEEDED) {
0 commit comments