1 Commits

Author SHA1 Message Date
c4cd7cdc79 fix timeout = None causing an instant timeout err 2020-04-05 19:47:28 +02:00
8 changed files with 7 additions and 1366 deletions

View File

@@ -1,24 +0,0 @@
kind: pipeline
name: default
steps:
- name: fmt
image: rust:1.43.0
commands:
- rustup component add rustfmt
- cargo fmt --all -- --check
- name: test
image: rust:1.43.0
commands:
- cargo test --all-features
- name: publish
image: rust:1.43.0
environment:
CARGO_REGISTRY_TOKEN:
from_secret: cargo_tkn
commands:
- grep -E 'version ?= ?"${DRONE_TAG}"' -i Cargo.toml || (printf "incorrect crate/tag version" && exit 1)
- cargo package --all-features
- cargo publish --all-features
when:
event: tag

View File

@@ -23,10 +23,6 @@ rust-crypto = "0.2"
csv-core = "0.1.6"
derive_builder = "0.9.0"
crossbeam = { version = "0.7.3", optional = true }
serde_derive = "1.0.106"
serde = "1.0.106"
serde_cbor = "0.11.1"
serde_bytes = "0.11.3"
[dev-dependencies]
crossbeam = "0.7.3"
hex = "0.4.0"

View File

@@ -24,7 +24,6 @@ fn main() -> ctap::FidoResult<()> {
FidoDevice::new(&h).and_then(|mut dev| {
FidoCredentialRequestBuilder::default()
.rp_id(RP_ID)
.user_name("test")
.build()
.unwrap()
.make_credential(&mut dev)

View File

@@ -597,45 +597,14 @@ impl CoseKey {
let mut cose_key = CoseKey::default();
cose_key.algorithm = -7;
for _ in 0..items {
match generic.value()? {
Value::Text(value::Text::Text(text)) => match &text[..] {
"type" => {
cose_key.key_type = match generic.value()? {
Value::Text(value::Text::Text(type_)) if &type_ == "public-key" => 0u16,
Value::U16(i) => i,
Value::U8(i) => i.into(),
_ => {
continue;
}
}
}
"alg" => cose_key.algorithm = generic.borrow_mut().i32()?,
_ => continue,
},
val @ Value::I8(_)
| val @ Value::I16(_)
| val @ Value::U16(_)
| val @ Value::U8(_) => {
let int_val = match val {
Value::I8(i) => i as i32,
Value::I16(i) => i as i32,
Value::U8(i) => i as i32,
Value::U16(i) => i as i32,
_ => unreachable!(),
};
match int_val {
0x01 => cose_key.key_type = generic.borrow_mut().u16()?,
0x02 => cose_key.algorithm = generic.borrow_mut().i32()?,
key if key < 0 => {
cose_key.parameters.insert(key as i16, generic.value()?);
}
unknown => {
(unknown, generic.value()?); // skip unknown parameter
}
}
match generic.borrow_mut().i16()? {
0x01 => cose_key.key_type = generic.borrow_mut().u16()?,
0x02 => cose_key.algorithm = generic.borrow_mut().i32()?,
key if key < 0 => {
cose_key.parameters.insert(key, generic.value()?);
}
unknown => {
(unknown, generic.value()?); // skip unknown parameter
_ => {
generic.value()?; // skip unknown parameter
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
use thiserror::Error;
#[derive(Clone, PartialEq, Eq, Debug)]
pub enum ProtocolError {
CborEncode,
CborDecode { data: Vec<u8> },
}

View File

@@ -1,4 +0,0 @@
mod cbor;
mod error;
pub use self::cbor::*;
pub use self::error::*;

View File

@@ -1,9 +0,0 @@
use crate::protocol::{CborRequest, CborResponse};
pub trait CtapTransport {
type Error;
fn cbor<'a>(&mut self, command: &CborRequest<'a>) -> Result<CborResponse, Self::Error>;
}
pub enum CtapCommand {}