# Softfido

This directory contains the modified version of [Softfido](https://github.com/ellerh/softfido) initially developed by [Helmut Eller](https://github.com/ellerh).

## Usage

The following description assumes you have created an authentication group on the MeeSign server.
If not, please follow the description in the main README file.

### Webauthn.io

The tool can be easily tested with [webauthn.io](https://webauthn.io/), but any FIDO2/U2F compatible service will work.

#### Tool Launch Using Bridge Controller

- I strongly recommend testing the util using Bridge Controller, as manual launch is not straightforward.

1. Configure and launch the interface using Bridge Controller

#### Manual Tool Launch

1. Load the vhci-hcd kernel module

```bash
sudo modprobe vhci-hcd
```

2. Run Softfido server
   As Softfido relies on Cryptoki Bridge, you have to configure Cryptoki Bridge using one of the provided methods described in its README file.

```bash
# if the group is configured using Cryptoki, e.g., using Bridge Controller, or group_id env variable
softfido --cryptoki-bridge-mode --pkcs11-module "/usr/lib/libcryptoki-bridge.so"
# or
# if the group is not specified and Cryptoki Bridge emulates all groups
softfido --token-label "Meesign <group name>" --pkcs11-module "/usr/lib/libcryptoki-bridge.so"
```

3. Attach the emulated token

```bash
sudo usbip attach -r 127.0.0.1 -d 1-1
```

## Installation

### Requirements

You'll need a vhci-hcd kernel module. (Already installed in the Bridge Box Virtualbox)

```bash
sudo apt-get install linux-modules-extra-$(uname -r)
```

### Debian-Based Distributions

already installed in Bridge Box

1. Install the Softfido package

### All Linux-Based Distributions

The built binary can be manually copied to `/usr/bin/`.

## Build

```bash
cargo build --release
```
