Bug 1418242 - [u2f-hid-rs] Let stubs fail, instead of running until cancellation r=jcj
authorTim Taubert <ttaubert@mozilla.com>
Thu, 16 Nov 2017 21:22:04 +0100
changeset 436863 3b1d7a28d1a522570825ec47fbcf831726ce6e99
parent 436862 5d567300c8f2b69f07747efc103de572d28ee2b8
child 436864 6dfe9e9f880079c77f54ae7d6501a7815ec4e772
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersjcj
bugs1418242
milestone59.0a1
Bug 1418242 - [u2f-hid-rs] Let stubs fail, instead of running until cancellation r=jcj https://github.com/jcjones/u2f-hid-rs/commit/1b1d79e65366f0457c3c183a36c86a11a04fb836
dom/webauthn/u2f-hid-rs/src/stub/mod.rs
--- a/dom/webauthn/u2f-hid-rs/src/stub/mod.rs
+++ b/dom/webauthn/u2f-hid-rs/src/stub/mod.rs
@@ -2,44 +2,45 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // No-op module to permit compiling token HID support for Android, where
 // no results are returned.
 
 #![allow(dead_code)]
 
-use util::OnceCallback;
+use util::{io_err, OnceCallback};
 
 pub struct PlatformManager {}
 
 impl PlatformManager {
     pub fn new() -> Self {
         Self {}
     }
 
     pub fn register(
         &mut self,
         timeout: u64,
         challenge: Vec<u8>,
         application: Vec<u8>,
         key_handles: Vec<Vec<u8>>,
         callback: OnceCallback<Vec<u8>>,
     ) {
-        // No-op on Android
+        // Not implemented.
+        callback.call(Err(io_err("not implemented")));
     }
 
     pub fn sign(
         &mut self,
         timeout: u64,
         challenge: Vec<u8>,
         application: Vec<u8>,
         key_handles: Vec<Vec<u8>>,
         callback: OnceCallback<(Vec<u8>, Vec<u8>)>,
     ) {
-        // No-op on Android
+        // Not implemented.
+        callback.call(Err(io_err("not implemented")));
     }
 
-    // This blocks.
     pub fn cancel(&mut self) {
-        // No-op on Android
+        // No-op.
     }
 }