git: 388dd4e9e293 - main - www/firefox: Restore webauth/security key usage

From: Christoph Moench-Tegeder <cmt_at_FreeBSD.org>
Date: Fri, 24 Mar 2023 21:24:02 UTC
The branch main has been updated by cmt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=388dd4e9e29324b86c19d656b5523013daa1837f

commit 388dd4e9e29324b86c19d656b5523013daa1837f
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2023-03-24 21:23:18 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2023-03-24 21:23:18 +0000

    www/firefox: Restore webauth/security key usage
    
    patch from upstream authenticator-rs
    https://github.com/mozilla/authenticator-rs/pull/238
    
    PR:             270092
    Reported By:    Thibault Payet
---
 www/firefox/Makefile               |  2 +-
 www/firefox/files/patch-bug1824066 | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/www/firefox/Makefile b/www/firefox/Makefile
index 8e433bfecc11..0fe303d40352 100644
--- a/www/firefox/Makefile
+++ b/www/firefox/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	firefox
 DISTVERSION=	111.0.1
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	2
 CATEGORIES=	www wayland
 MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}${DISTVERSIONSUFFIX}/source \
diff --git a/www/firefox/files/patch-bug1824066 b/www/firefox/files/patch-bug1824066
new file mode 100644
index 000000000000..cce34e9eb196
--- /dev/null
+++ b/www/firefox/files/patch-bug1824066
@@ -0,0 +1,37 @@
+commit c017c06d61545a86338a1cbc73967803c5a2a6bc
+Author: John M. Schanck <jschanck@mozilla.com>
+Date:   Thu Mar 23 12:13:44 2023 -0700
+
+    Apply pr234 patch to transports/freebsd
+
+diff --git third_party/rust/authenticator/src/transport/freebsd/device.rs third_party/rust/authenticator/src/transport/freebsd/device.rs
+index 8f4de54..3a83be2 100644
+--- third_party/rust/authenticator/src/transport/freebsd/device.rs
++++ third_party/rust/authenticator/src/transport/freebsd/device.rs
+@@ -41,7 +41,9 @@ impl Device {
+             buf[6] = 0;
+             buf[7] = 1; // one byte
+ 
+-            self.write_all(&buf)?;
++            if self.write(&buf)? != buf.len() {
++                return Err(io_err("write ping failed"));
++            }
+ 
+             // Wait for response
+             let mut pfd: libc::pollfd = unsafe { mem::zeroed() };
+@@ -56,8 +58,13 @@ impl Device {
+                 continue;
+             }
+ 
+-            // Read response
+-            self.read_exact(&mut buf)?;
++            // Read response.  When reports come in they are all
++            // exactly the same size, with no report id byte because
++            // there is only one report.
++            let n = self.read(&mut buf[1..])?;
++            if n != buf.len() - 1 {
++                return Err(io_err("read pong failed"));
++            }
+ 
+             return Ok(());
+         }