cbor: rename crate to sk-cbor

In anticipation of publishing to crates.io, which already has a `cbor`
crate.
This commit is contained in:
David Drysdale
2021-06-08 11:26:24 +01:00
committed by kaczmarczyck
parent f2812e4fe2
commit 7719078d46
15 changed files with 26 additions and 16 deletions

View File

@@ -13,7 +13,7 @@ edition = "2018"
libtock_core = { path = "third_party/libtock-rs/core" }
libtock_drivers = { path = "third_party/libtock-drivers" }
lang_items = { path = "third_party/lang-items" }
cbor = { path = "libraries/cbor" }
sk-cbor = { path = "libraries/cbor" }
crypto = { path = "libraries/crypto" }
persistent_store = { path = "libraries/persistent_store" }
byteorder = { version = "1", default-features = false }

View File

@@ -9,6 +9,6 @@ edition = "2018"
arrayref = "0.3.6"
libtock_drivers = { path = "../../third_party/libtock-drivers" }
crypto = { path = "../../libraries/crypto", features = ['std'] }
cbor = { path = "../../libraries/cbor" }
sk-cbor = { path = "../../libraries/cbor" }
ctap2 = { path = "../..", features = ['std'] }
lang_items = { path = "../../third_party/lang-items", features = ['std'] }

View File

@@ -29,6 +29,7 @@ use ctap2::ctap::hid::{ChannelID, CtapHid, HidPacket, Message};
use ctap2::ctap::status_code::Ctap2StatusCode;
use ctap2::ctap::CtapState;
use libtock_drivers::timer::{ClockValue, Timestamp};
use sk_cbor as cbor;
const COMMAND_INIT: u8 = 0x06;
const CHANNEL_BROADCAST: ChannelID = [0xFF, 0xFF, 0xFF, 0xFF];

View File

@@ -1,5 +1,5 @@
[package]
name = "cbor"
name = "sk-cbor"
version = "0.1.0"
authors = [
"Fabian Kaczmarczyck <kaczmarczyck@google.com>",

View File

@@ -1,6 +1,6 @@
[package]
name = "cbor-fuzz"
name = "sk-cbor-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
@@ -12,7 +12,7 @@ cargo-fuzz = true
[dependencies]
libfuzzer-sys = "0.3"
[dependencies.cbor]
[dependencies.sk-cbor]
path = ".."
# Prevent this from interfering with workspaces

View File

@@ -3,6 +3,7 @@ extern crate alloc;
use alloc::vec::Vec;
use libfuzzer_sys::fuzz_target;
use sk_cbor as cbor;
fuzz_target!(|data: &[u8]| {
if let Ok(value) = cbor::read(data) {

View File

@@ -36,7 +36,7 @@ use core::iter::Peekable;
///
/// ```rust
/// # extern crate alloc;
/// # use cbor::destructure_cbor_map;
/// # use sk_cbor::destructure_cbor_map;
/// #
/// # fn main() {
/// # let map = alloc::vec::Vec::new();
@@ -143,7 +143,7 @@ macro_rules! assert_sorted_keys {
///
/// ```rust
/// # extern crate alloc;
/// # use cbor::cbor_map;
/// # use sk_cbor::cbor_map;
/// let map = cbor_map! {
/// 0x01 => false,
/// "02" => -3,
@@ -182,7 +182,7 @@ macro_rules! cbor_map {
///
/// ```rust
/// # extern crate alloc;
/// # use cbor::cbor_map_options;
/// # use sk_cbor::cbor_map_options;
/// let missing_value: Option<bool> = None;
/// let map = cbor_map_options! {
/// 0x01 => Some(false),
@@ -232,7 +232,7 @@ macro_rules! cbor_map_collection {
///
/// ```rust
/// # extern crate alloc;
/// # use cbor::cbor_array;
/// # use sk_cbor::cbor_array;
/// let array = cbor_array![1, "2"];
/// ```
#[macro_export]
@@ -339,7 +339,7 @@ macro_rules! cbor_bytes {
///
/// ```rust
/// # extern crate alloc;
/// # use cbor::cbor_bytes_lit;
/// # use sk_cbor::cbor_bytes_lit;
/// let byte_array = cbor_bytes_lit!(b"foo");
/// ```
#[macro_export]

View File

@@ -11,7 +11,6 @@ edition = "2018"
[dependencies]
libtock_drivers = { path = "../../third_party/libtock-drivers" }
cbor = { path = "../cbor" }
arrayref = "0.3.6"
subtle = { version = "2.2.3", default-features = false, features = ["nightly"] }
byteorder = { version = "1", default-features = false }

View File

@@ -26,8 +26,9 @@ use super::status_code::Ctap2StatusCode;
use alloc::string::String;
use alloc::vec::Vec;
use arrayref::array_ref;
use cbor::destructure_cbor_map;
use core::convert::TryFrom;
use sk_cbor as cbor;
use sk_cbor::destructure_cbor_map;
// This constant is a consequence of the structure of messages.
const MIN_LARGE_BLOB_LEN: usize = 17;

View File

@@ -20,6 +20,7 @@ use super::response::ResponseData;
use super::status_code::Ctap2StatusCode;
use super::storage::PersistentStore;
use alloc::vec;
use sk_cbor as cbor;
/// Processes the subcommand enableEnterpriseAttestation for AuthenticatorConfig.
fn process_enable_enterprise_attestation(

View File

@@ -30,6 +30,7 @@ use alloc::vec::Vec;
use crypto::sha256::Sha256;
use crypto::Hash256;
use libtock_drivers::timer::ClockValue;
use sk_cbor as cbor;
/// Generates a set with all existing RP IDs.
fn get_stored_rp_ids(

View File

@@ -16,11 +16,12 @@ use super::status_code::Ctap2StatusCode;
use alloc::string::String;
use alloc::vec::Vec;
use arrayref::array_ref;
use cbor::{cbor_array_vec, cbor_map, cbor_map_options, destructure_cbor_map};
use core::convert::TryFrom;
use crypto::{ecdh, ecdsa};
#[cfg(test)]
use enum_iterator::IntoEnumIterator;
use sk_cbor as cbor;
use sk_cbor::{cbor_array_vec, cbor_map, cbor_map_options, destructure_cbor_map};
// Used as the identifier for ECDSA in assertion signatures and COSE.
const ES256_ALGORITHM: i64 = -7;

View File

@@ -68,7 +68,6 @@ use alloc::vec;
use alloc::vec::Vec;
use arrayref::array_ref;
use byteorder::{BigEndian, ByteOrder};
use cbor::cbor_map_options;
use core::convert::TryFrom;
#[cfg(feature = "debug_ctap")]
use core::fmt::Write;
@@ -80,6 +79,8 @@ use crypto::Hash256;
use libtock_drivers::console::Console;
use libtock_drivers::crp;
use libtock_drivers::timer::{ClockValue, Duration};
use sk_cbor as cbor;
use sk_cbor::cbor_map_options;
pub const INITIAL_SIGNATURE_COUNTER: u32 = 1;
// Our credential ID consists of

View File

@@ -19,7 +19,10 @@ use super::data_formats::{
};
use alloc::string::String;
use alloc::vec::Vec;
use cbor::{cbor_array_vec, cbor_bool, cbor_int, cbor_map_collection, cbor_map_options, cbor_text};
use sk_cbor as cbor;
use sk_cbor::{
cbor_array_vec, cbor_bool, cbor_int, cbor_map_collection, cbor_map_options, cbor_text,
};
#[derive(Debug, PartialEq)]
pub enum ResponseData {

View File

@@ -32,11 +32,12 @@ use alloc::string::String;
use alloc::vec;
use alloc::vec::Vec;
use arrayref::array_ref;
use cbor::cbor_array_vec;
use core::cmp;
use core::convert::TryInto;
use crypto::rng256::Rng256;
use persistent_store::{fragment, StoreUpdate};
use sk_cbor as cbor;
use sk_cbor::cbor_array_vec;
/// Wrapper for master keys.
pub struct MasterKeys {