util.sasl.scram: Add support for 'tls-exporter' channel binding

Wed, 03 Aug 2022 03:07:16 +0200

author
Kim Alvefur <zash@zash.se>
date
Wed, 03 Aug 2022 03:07:16 +0200
changeset 455
753d6983dc45
parent 454
9f27a2075e9e
child 456
6a65142052c8

util.sasl.scram: Add support for 'tls-exporter' channel binding

Ref https://issues.prosody.im/1760

util/sasl/scram.lua file | annotate | diff | comparison | revisions
--- a/util/sasl/scram.lua	Wed Aug 03 03:06:26 2022 +0200
+++ b/util/sasl/scram.lua	Wed Aug 03 03:07:16 2022 +0200
@@ -39,7 +39,9 @@
 	if conn:ssl() then
 		local sock = conn:socket();
 		if sock.info and sock:info().protocol == "TLSv1.3" then
-			return false
+			if sock.exportkeyingmaterial then
+				return "p=tls-exporter", sock:exportkeyingmaterial("EXPORTER-Channel-Binding", 32, "");
+			end
 		elseif sock.getfinished then
 			return "p=tls-unique", sock:getfinished();
 		end

mercurial