Remove unused dh_blob parameter

This was used earlier in the wpa_supplicant configuration, but there was
no real use for that, so remove the now completely unused parameter to
simplify implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2022-04-16 10:45:17 +03:00
parent 4a774cf317
commit 28c1c91d03
4 changed files with 3 additions and 25 deletions

View file

@ -148,8 +148,6 @@ struct tls_config {
* @private_key_passwd: Passphrase for decrypted private key, %NULL if no * @private_key_passwd: Passphrase for decrypted private key, %NULL if no
* passphrase is used. * passphrase is used.
* @dh_file: File name for DH/DSA data in PEM format, or %NULL if not used * @dh_file: File name for DH/DSA data in PEM format, or %NULL if not used
* @dh_blob: dh_file as inlined data or %NULL if not used
* @dh_blob_len: dh_blob length
* @engine: 1 = use engine (e.g., a smartcard) for private key operations * @engine: 1 = use engine (e.g., a smartcard) for private key operations
* (this is OpenSSL specific for now) * (this is OpenSSL specific for now)
* @engine_id: engine id string (this is OpenSSL specific for now) * @engine_id: engine id string (this is OpenSSL specific for now)
@ -198,8 +196,6 @@ struct tls_connection_params {
const char *private_key_passwd; const char *private_key_passwd;
const char *private_key_passwd2; const char *private_key_passwd2;
const char *dh_file; const char *dh_file;
const u8 *dh_blob;
size_t dh_blob_len;
/* OpenSSL specific variables */ /* OpenSSL specific variables */
int engine; int engine;

View file

@ -335,8 +335,7 @@ int tls_global_set_params(void *tls_ctx,
return -1; return -1;
} }
if (tlsv1_set_dhparams(cred, params->dh_file, params->dh_blob, if (tlsv1_set_dhparams(cred, params->dh_file, NULL, 0)) {
params->dh_blob_len)) {
wpa_printf(MSG_INFO, "TLS: Failed to load DH parameters"); wpa_printf(MSG_INFO, "TLS: Failed to load DH parameters");
return -1; return -1;
} }

View file

@ -3953,7 +3953,6 @@ static int tls_global_dh(struct tls_data *data, const char *dh_file)
DH *dh; DH *dh;
BIO *bio; BIO *bio;
/* TODO: add support for dh_blob */
if (dh_file == NULL) if (dh_file == NULL)
return 0; return 0;
if (ssl_ctx == NULL) if (ssl_ctx == NULL)

View file

@ -1383,25 +1383,10 @@ static int tls_global_private_key(void *ssl_ctx, const char *private_key,
} }
static int tls_global_dh(void *ssl_ctx, const char *dh_file, static int tls_global_dh(void *ssl_ctx, const char *dh_file)
const u8 *dh_blob, size_t blob_len)
{ {
WOLFSSL_CTX *ctx = ssl_ctx; WOLFSSL_CTX *ctx = ssl_ctx;
if (!dh_file && !dh_blob)
return 0;
if (dh_blob) {
if (wolfSSL_CTX_SetTmpDH_buffer(ctx, dh_blob, blob_len,
SSL_FILETYPE_ASN1) < 0) {
wpa_printf(MSG_INFO,
"SSL: global use DH DER blob failed");
return -1;
}
wpa_printf(MSG_DEBUG, "SSL: global use DH blob OK");
return 0;
}
if (dh_file) { if (dh_file) {
if (wolfSSL_CTX_SetTmpDH_file(ctx, dh_file, SSL_FILETYPE_PEM) < if (wolfSSL_CTX_SetTmpDH_file(ctx, dh_file, SSL_FILETYPE_PEM) <
0) { 0) {
@ -1488,8 +1473,7 @@ int tls_global_set_params(void *tls_ctx,
return -1; return -1;
} }
if (tls_global_dh(tls_ctx, params->dh_file, params->dh_blob, if (tls_global_dh(tls_ctx, params->dh_file) < 0) {
params->dh_blob_len) < 0) {
wpa_printf(MSG_INFO, "SSL: Failed to load DH file '%s'", wpa_printf(MSG_INFO, "SSL: Failed to load DH file '%s'",
params->dh_file); params->dh_file);
return -1; return -1;