target/mips: Use OPC_MUL instead of OPC__MXU_MUL
[qemu/ar7.git] / docs / u2f.txt
blob8f44994818a23de44482d7ca2ad099b332598ade
1 QEMU U2F Key Device Documentation.
3 Contents
4 1. USB U2F key device
5 2. Building
6 3. Using u2f-emulated
7 4. Using u2f-passthru
8 5. Libu2f-emu
10 1. USB U2F key device
12 U2F is an open authentication standard that enables relying parties
13 exposed to the internet to offer a strong second factor option for end
14 user authentication.
16 The standard brings many advantages to both parties, client and server,
17 allowing to reduce over-reliance on passwords, it increases authentication
18 security and simplifies passwords.
20 The second factor is materialized by a device implementing the U2F
21 protocol. In case of a USB U2F security key, it is a USB HID device
22 that implements the U2F protocol.
24 In Qemu, the USB U2F key device offers a dedicated support of U2F, allowing
25 guest USB FIDO/U2F security keys operating in two possible modes:
26 pass-through and emulated.
28 The pass-through mode consists of passing all requests made from the guest
29 to the physical security key connected to the host machine and vice versa.
30 In addition, the dedicated pass-through allows to have a U2F security key
31 shared on several guests which is not possible with a simple host device
32 assignment pass-through.
34 The emulated mode consists of completely emulating the behavior of an
35 U2F device through software part. Libu2f-emu is used for that.
38 2. Building
40 To ensure the build of the u2f-emulated device variant which depends
41 on libu2f-emu: configuring and building:
43     ./configure --enable-u2f && make
45 The pass-through mode is built by default on Linux. To take advantage
46 of the autoscan option it provides, make sure you have a working libudev
47 installed on the host.
50 3. Using u2f-emulated
52 To work, an emulated U2F device must have four elements:
53  * ec x509 certificate
54  * ec private key
55  * counter (four bytes value)
56  * 48 bytes of entropy (random bits)
58 To use this type of device, this one has to be configured, and these
59 four elements must be passed one way or another.
61 Assuming that you have a working libu2f-emu installed on the host.
62 There are three possible ways of configurations:
63  * ephemeral
64  * setup directory
65  * manual
67 Ephemeral is the simplest way to configure, it lets the device generate
68 all the elements it needs for a single use of the lifetime of the device.
70     qemu -usb -device u2f-emulated
72 Setup directory allows to configure the device from a directory containing
73 four files:
74  * certificate.pem: ec x509 certificate
75  * private-key.pem: ec private key
76  * counter: counter value
77  * entropy: 48 bytes of entropy
79     qemu -usb -device u2f-emulated,dir=$dir
81 Manual allows to configure the device more finely by specifying each
82 of the elements necessary for the device:
83  * cert
84  * priv
85  * counter
86  * entropy
88     qemu -usb -device u2f-emulated,cert=$DIR1/$FILE1,priv=$DIR2/$FILE2,counter=$DIR3/$FILE3,entropy=$DIR4/$FILE4
91 4. Using u2f-passthru
93 On the host specify the u2f-passthru device with a suitable hidraw:
95     qemu -usb -device u2f-passthru,hidraw=/dev/hidraw0
97 Alternately, the u2f-passthru device can autoscan to take the first
98 U2F device it finds on the host (this requires a working libudev):
100     qemu -usb -device u2f-passthru
103 5. Libu2f-emu
105 The u2f-emulated device uses libu2f-emu for the U2F key emulation. Libu2f-emu
106 implements completely the U2F protocol device part for all specified
107 transport given by the FIDO Alliance.
109 For more information about libu2f-emu see this page:
110 https://github.com/MattGorko/libu2f-emu.