TLS testing: Allow hostapd to be used as a TLS testing tool
The internal TLS server implementation and RADIUS server implementation in hostapd can be configured to allow EAP clients to be tested to perform TLS validation steps correctly. This functionality is not included in the default build; CONFIG_TESTING_OPTIONS=y in hostapd/.config can be used to enable this. When enabled, the RADIUS server will configure special TLS test modes based on the received User-Name attribute value in this format: <user>@test-tls-<id>.<rest-of-realm>. For example, anonymous@test-tls-1.example.com. When this special format is used, TLS test modes are enabled. For other cases, the RADIUS server works normally. The following TLS test cases are enabled in this commit: 1 - break verify_data in the server Finished message 2 - break signed_params hash in ServerKeyExchange 3 - break Signature in ServerKeyExchange Correctly behaving TLS client must abort connection if any of these failures is detected and as such, shall not transmit continue the session. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
994afe3390
commit
390b92913a
12 changed files with 150 additions and 0 deletions
|
@ -541,4 +541,10 @@ void tls_connection_set_log_cb(struct tls_connection *conn,
|
|||
void (*log_cb)(void *ctx, const char *msg),
|
||||
void *ctx);
|
||||
|
||||
#define TLS_BREAK_VERIFY_DATA BIT(0)
|
||||
#define TLS_BREAK_SRV_KEY_X_HASH BIT(1)
|
||||
#define TLS_BREAK_SRV_KEY_X_SIGNATURE BIT(2)
|
||||
|
||||
void tls_connection_set_test_flags(struct tls_connection *conn, u32 flags);
|
||||
|
||||
#endif /* TLS_H */
|
||||
|
|
|
@ -111,6 +111,17 @@ struct tls_connection * tls_connection_init(void *tls_ctx)
|
|||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_TESTING_OPTIONS
|
||||
#ifdef CONFIG_TLS_INTERNAL_SERVER
|
||||
void tls_connection_set_test_flags(struct tls_connection *conn, u32 flags)
|
||||
{
|
||||
if (conn->server)
|
||||
tlsv1_server_set_test_flags(conn->server, flags);
|
||||
}
|
||||
#endif /* CONFIG_TLS_INTERNAL_SERVER */
|
||||
#endif /* CONFIG_TESTING_OPTIONS */
|
||||
|
||||
|
||||
void tls_connection_set_log_cb(struct tls_connection *conn,
|
||||
void (*log_cb)(void *ctx, const char *msg),
|
||||
void *ctx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue