Skip to contentSkip to conversation

eap-tls: Dump server certificate when IWD_TLS_DEBUG set

PATCH Applied Andrew Zaborowski 2 participants 5 messages Dec 23, 2020 – Jan 9, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 eap-tls: Dump server certificate when IWD_TLS_DEBUG set

---
 src/eap-tls-common.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
src/eap-tls-common.c +4 -1
index c3eb5ab3..68e2a10c 100644
@@ -583,9 +583,12 @@ static bool eap_tls_tunnel_init(struct eap_state *eap)
 		return false;
 	}
 
-	if (getenv("IWD_TLS_DEBUG"))
+	if (getenv("IWD_TLS_DEBUG")) {
 		l_tls_set_debug(eap_tls->tunnel, eap_tls_tunnel_debug, eap,
 									NULL);
+		l_tls_set_cert_dump_path(eap_tls->tunnel,
+					"/tmp/iwd-tls-debug-server-cert.pem");
+	}
 
 	if (eap_tls->client_cert || eap_tls->client_key) {
 		if (!l_tls_set_auth_data(eap_tls->tunnel, eap_tls->client_cert,
Signature · 1 line
2.27.0
#1 lore raw

PATCH 2/2 crypto: Update l_pkcs5_pbkdf2 call after rename

---
This fixes up crypto_psk_from_passphrase after the rename in ell and should only be applied if/after the commit
"pkcs5: Rename to cert-crypto" is pushed to ell.

---
 src/crypto.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
src/crypto.c +3 -2
index f5f8e24d..563f17ce 100644
@@ -552,8 +552,9 @@ int crypto_psk_from_passphrase(const char *passphrase,
 	if (ssid_len == 0 || ssid_len > 32)
 		return -ERANGE;
 
-	result = l_pkcs5_pbkdf2(L_CHECKSUM_SHA1, passphrase, ssid, ssid_len,
-				4096, psk, sizeof(psk));
+	result = l_cert_pkcs5_pbkdf2(L_CHECKSUM_SHA1, passphrase,
+					ssid, ssid_len, 4096,
+					psk, sizeof(psk));
 	if (!result)
 		return -ENOKEY;
 
Signature · 1 line
2.27.0
#2 lore raw

Re: [PATCH 2/2] crypto: Update l_pkcs5_pbkdf2 call after rename

Hi Andrew,

Quoted 8 lines · Andrew Zaborowski

---
This fixes up crypto_psk_from_passphrase after the rename in ell and should only be applied if/after the commit
"pkcs5: Rename to cert-crypto" is pushed to ell.

---
  src/crypto.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

Applied, thanks.

I also made some build updates prior to this commit that were needed due to pkcs5.c restructuring. Please sanity check...

Regards,
-Denis

#3 lore raw

Re: [PATCH 2/2] crypto: Update l_pkcs5_pbkdf2 call after rename

Hi Denis,

Quoted 4 lines · Denis Kenzior

Applied, thanks.

I also made some build updates prior to this commit that were needed due to pkcs5.c restructuring. Please sanity check...

Yes, looks good, I must have forgotten to add them to the patch because I did build iwd.

Best regards