From 9384403ff1f08d1443451073d8eec6558128ac8c Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Wed, 2 Aug 2023 16:39:56 -0700 Subject: [PATCH 1/5] remove indy_vdr specific parts of indy-utils Signed-off-by: Andrew Whitehead --- indy-utils/Cargo.toml | 26 ++--- indy-utils/src/base64.rs | 18 ---- indy-utils/src/lib.rs | 8 -- indy-utils/src/txn_signature.rs | 178 -------------------------------- 4 files changed, 14 insertions(+), 216 deletions(-) delete mode 100644 indy-utils/src/base64.rs delete mode 100644 indy-utils/src/txn_signature.rs diff --git a/indy-utils/Cargo.toml b/indy-utils/Cargo.toml index b66c1e2..275b31c 100644 --- a/indy-utils/Cargo.toml +++ b/indy-utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "indy-utils" -version = "0.5.2" +version = "0.6.0" authors = ["Hyperledger Indy Contributors "] description = "Utilities for Hyperledger Indy (https://www.hyperledger.org/projects), which provides a distributed-ledger-based foundation for self-sovereign identity (https://sovrin.org)." edition = "2018" @@ -16,29 +16,31 @@ path = "src/lib.rs" crate-type = ["rlib"] [features] -default = ["ed25519", "hash", "txn_signature"] -base64 = ["base64_rs"] +default = ["ed25519", "hash"] ed25519 = ["curve25519-dalek", "ed25519-dalek", "rand", "sha2", "x25519-dalek"] hash = ["sha2"] -txn_signature = ["hex", "sha2", "serde", "serde_json"] [dependencies] -base64_rs = { package = "base64", version = "0.13", optional = true } -bs58 = "0.4" -curve25519-dalek = { version = "3.1", default-features = false, features = ["u64_backend"], optional = true } -ed25519-dalek = { version = "1.0", default-features = false, features = ["u64_backend"], optional = true } -hex = { version = "0.4", optional = true } +bs58 = "0.5" +curve25519-dalek = { version = "3.1", default-features = false, features = [ + "u64_backend", +], optional = true } +ed25519-dalek = { version = "1.0", default-features = false, features = [ + "u64_backend", +], optional = true } once_cell = "1.9" rand = { version = "0.8", optional = true } regex = "1.3" serde = { version = "1.0", optional = true, features = ["derive"] } serde_json = { version = "1.0", optional = true } -sha2 = { version = "0.9", optional = true } +sha2 = { version = "0.10", optional = true } thiserror = "1.0" -x25519-dalek = { version = "=1.2", default-features = false, features = ["u64_backend"], optional = true } +x25519-dalek = { version = "=1.2", default-features = false, features = [ + "u64_backend", +], optional = true } zeroize = { version = "1.3" } [dev-dependencies] -async-global-executor = "1.2" +async-global-executor = "2.3" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/indy-utils/src/base64.rs b/indy-utils/src/base64.rs deleted file mode 100644 index d8b2f3a..0000000 --- a/indy-utils/src/base64.rs +++ /dev/null @@ -1,18 +0,0 @@ -use base64_rs as base64; - -pub use base64::encode; - -use crate::error::ConversionError; - -pub fn decode>(val: T) -> Result, ConversionError> { - Ok(base64::decode(val).map_err(|err| ("Error decoding base64 data", err))?) -} - -pub fn decode_urlsafe>(val: T) -> Result, ConversionError> { - Ok(base64::decode_config(val, base64::URL_SAFE) - .map_err(|err| ("Error decoding base64-URL data", err))?) -} - -pub fn encode_urlsafe>(val: T) -> String { - base64::encode_config(val, base64::URL_SAFE) -} diff --git a/indy-utils/src/lib.rs b/indy-utils/src/lib.rs index b73578a..8b92c9c 100644 --- a/indy-utils/src/lib.rs +++ b/indy-utils/src/lib.rs @@ -28,14 +28,6 @@ pub mod did; /// Indy signing keys and verification keys pub mod keys; -/// Base64 encoding and decoding -#[cfg(feature = "base64")] -pub mod base64; - /// Hash algorithms #[cfg(feature = "hash")] pub mod hash; - -/// Generation of normalized ledger transaction for signing -#[cfg(feature = "txn_signature")] -pub mod txn_signature; diff --git a/indy-utils/src/txn_signature.rs b/indy-utils/src/txn_signature.rs deleted file mode 100644 index b3f8f11..0000000 --- a/indy-utils/src/txn_signature.rs +++ /dev/null @@ -1,178 +0,0 @@ -use serde_json::Value as SJsonValue; - -use super::error::ValidationError; -use super::hash::SHA256; - -const ATTRIB: &str = "100"; -const GET_ATTR: &str = "104"; - -/// Generate the normalized form of a ledger transaction request for signing -pub fn serialize_signature(v: &SJsonValue) -> Result { - let _type = v["operation"]["type"].clone(); - _serialize_signature(v, true, _type.as_str()) -} - -fn _serialize_signature( - v: &SJsonValue, - is_top_level: bool, - _type: Option<&str>, -) -> Result { - match v { - SJsonValue::Bool(value) => Ok(if *value { - "True".to_string() - } else { - "False".to_string() - }), - SJsonValue::Number(value) => Ok(value.to_string()), - SJsonValue::String(value) => Ok(value.to_string()), - SJsonValue::Array(array) => array - .into_iter() - .map(|element| _serialize_signature(element, false, _type)) - .collect::, ValidationError>>() - .map(|res| res.join(",")), - SJsonValue::Object(map) => { - let mut result = "".to_string(); - let mut in_middle = false; - for key in map.keys() { - // Skip signature field at top level as in python code - if is_top_level && (key == "signature" || key == "fees" || key == "signatures") { - continue; - } - - if in_middle { - result += "|"; - } - - let mut value = map[key].clone(); - if (_type == Some(ATTRIB) || _type == Some(GET_ATTR)) - && (key == "raw" || key == "hash" || key == "enc") - { - // do it only for attribute related request - let hash = SHA256::digest( - &value - .as_str() - .ok_or_else(|| invalid!("Cannot update hash context"))? - .as_bytes(), - ); - value = SJsonValue::String(hex::encode(hash)); - } - result = result + key + ":" + &_serialize_signature(&value, false, _type)?; - in_middle = true; - } - Ok(result) - } - _ => Ok("".to_string()), - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn signature_serialize_works() { - let data = r#"{ - "name": "John Doe", - "age": 43, - "operation": { - "dest": 54 - }, - "phones": [ - "1234567", - "2345678", - {"rust": 5, "age": 1}, - 3 - ] - }"#; - let msg: SJsonValue = serde_json::from_str(data).unwrap(); - - let result = "age:43|name:John Doe|operation:dest:54|phones:1234567,2345678,age:1|rust:5,3"; - - assert_eq!(serialize_signature(&msg).unwrap(), result) - } - - #[test] - fn signature_serialize_works_for_skipped_fields() { - let data = r#"{ - "name": "John Doe", - "age": 43, - "operation": { - "type": "100", - "hash": "cool hash", - "dest": 54 - }, - "fees": "fees1", - "signature": "sign1", - "signatures": "sign-m", - "phones": [ - "1234567", - "2345678", - {"rust": 5, "age": 1}, - 3 - ] - }"#; - let msg: SJsonValue = serde_json::from_str(data).unwrap(); - - let result = "age:43|name:John Doe|operation:dest:54|hash:46aa0c92129b33ee72ee1478d2ae62fa6e756869dedc6c858af3214a6fcf1904|type:100|phones:1234567,2345678,age:1|rust:5,3"; - - assert_eq!(serialize_signature(&msg).unwrap(), result) - } - - #[test] - fn signature_serialize_works_with_raw_hash_for_attrib_related_type() { - let data = r#"{ - "name": "John Doe", - "age": 43, - "operation": { - "type": "100", - "hash": "cool hash", - "dest": 54, - "raw": "string for hash" - }, - "phones": [ - "1234567", - "2345678", - {"rust": 5, "age": 1}, - 3 - ] - }"#; - let msg: SJsonValue = serde_json::from_str(data).unwrap(); - - let result = "age:43|name:John Doe|operation:dest:54|hash:46aa0c92129b33ee72ee1478d2ae62fa6e756869dedc6c858af3214a6fcf1904|raw:1dcd0759ce38f57049344a6b3c5fc18144fca1724713090c2ceeffa788c02711|type:100|phones:1234567,2345678,age:1|rust:5,3"; - - assert_eq!(serialize_signature(&msg).unwrap(), result) - } - - #[test] - fn signature_serialize_works_with_raw_hash_for_not_attrib_related_type() { - let data = r#"{ - "name": "John Doe", - "age": 43, - "operation": { - "type": "101", - "hash": "cool hash", - "dest": 54, - "raw": "string for hash" - }, - "phones": [ - "1234567", - "2345678", - {"rust": 5, "age": 1}, - 3 - ] - }"#; - let msg: SJsonValue = serde_json::from_str(data).unwrap(); - - let result = "age:43|name:John Doe|operation:dest:54|hash:cool hash|raw:string for hash|type:101|phones:1234567,2345678,age:1|rust:5,3"; - - assert_eq!(serialize_signature(&msg).unwrap(), result) - } - - #[test] - fn signature_serialize_works_with_null() { - let data = r#"{"signature": null}"#; - let msg: serde_json::Value = serde_json::from_str(data).unwrap(); - let serialized = serialize_signature(&msg).unwrap(); - assert_eq!(serialized, ""); - } -} From dfe94c67a5d343483a4a0cedde2f634ee204304c Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Wed, 2 Aug 2023 16:41:24 -0700 Subject: [PATCH 2/5] update to anoncreds-clsignatures 0.2 Signed-off-by: Andrew Whitehead --- indy-data-types/Cargo.toml | 22 +++++++++++++------- indy-data-types/src/anoncreds/cred_def.rs | 1 + indy-data-types/src/anoncreds/link_secret.rs | 8 +++---- indy-data-types/src/lib.rs | 1 + 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/indy-data-types/Cargo.toml b/indy-data-types/Cargo.toml index f00048f..77c2319 100644 --- a/indy-data-types/Cargo.toml +++ b/indy-data-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "indy-data-types" -version = "0.6.0" +version = "0.6.1" authors = ["Hyperledger Indy Contributors "] description = "Common data types for Hyperledger Indy (https://www.hyperledger.org/projects), which provides a distributed-ledger-based foundation for self-sovereign identity (https://sovrin.org)." edition = "2021" @@ -16,25 +16,31 @@ path = "src/lib.rs" crate-type = ["rlib"] [features] -default = ["serde_support", "cl_native"] -cl = ["serde_support"] -cl_native = ["serde_support", "anoncreds-clsignatures/openssl_bn"] +default = ["anoncreds", "merkle_tree"] +anoncreds = ["serde_support"] +cl = ["anoncreds", "anoncreds-clsignatures", "serde_support"] +cl_native = ["anoncreds", "anoncreds-clsignatures/openssl_bn", "serde_support"] merkle_tree = ["indy-utils/hash", "hex"] rich_schema = [] -serde_support = ["serde", "serde_json", "anoncreds-clsignatures?/serde", "indy-utils/serde"] +serde_support = [ + "serde", + "serde_json", + "anoncreds-clsignatures?/serde", + "indy-utils/serde", +] vendored = ["anoncreds-clsignatures?/openssl_vendored"] [dependencies] -anoncreds-clsignatures = { version = "0.1", optional = true } +anoncreds-clsignatures = { version = "0.2", optional = true } hex = { version = "0.4", optional = true } once_cell = "1" regex = "1" serde = { version = "1.0", optional = true, features = ["derive"] } serde_json = { version = "1.0", optional = true, features = ["raw_value"] } zeroize = { version = "1", features = ["zeroize_derive"] } - +rmp-serde = "1.0" [dependencies.indy-utils] -version = "0.5" +version = "0.6" path = "../indy-utils" default-features = false diff --git a/indy-data-types/src/anoncreds/cred_def.rs b/indy-data-types/src/anoncreds/cred_def.rs index 34cc10a..17a6ba0 100644 --- a/indy-data-types/src/anoncreds/cred_def.rs +++ b/indy-data-types/src/anoncreds/cred_def.rs @@ -1,3 +1,4 @@ +#[cfg(any(feature = "cl", feature = "cl_native"))] use crate::anoncreds_clsignatures::CredentialPublicKey; use crate::identifiers::cred_def::CredentialDefinitionId; use crate::identifiers::schema::SchemaId; diff --git a/indy-data-types/src/anoncreds/link_secret.rs b/indy-data-types/src/anoncreds/link_secret.rs index cad690b..b23887f 100644 --- a/indy-data-types/src/anoncreds/link_secret.rs +++ b/indy-data-types/src/anoncreds/link_secret.rs @@ -2,20 +2,20 @@ use std::fmt; use serde::{Deserialize, Serialize}; -use crate::anoncreds_clsignatures::{MasterSecret as ClMasterSecret, Prover as ClProver}; +use crate::anoncreds_clsignatures::{LinkSecret as ClLinkSecret, Prover as ClProver}; use crate::ConversionError; #[derive(Serialize, Deserialize)] pub struct LinkSecret { - pub value: ClMasterSecret, + pub value: ClLinkSecret, } impl LinkSecret { #[cfg(any(feature = "cl", feature = "cl_native"))] #[inline] pub fn new() -> Result { - let value = ClProver::new_master_secret().map_err(|err| { - ConversionError::from_msg(format!("Error creating master secret: {}", err)) + let value = ClProver::new_link_secret().map_err(|err| { + ConversionError::from_msg(format!("Error creating link secret: {}", err)) })?; Ok(Self { value }) } diff --git a/indy-data-types/src/lib.rs b/indy-data-types/src/lib.rs index d2faa73..e69b922 100644 --- a/indy-data-types/src/lib.rs +++ b/indy-data-types/src/lib.rs @@ -21,6 +21,7 @@ pub use indy_utils::{invalid, ConversionError, Validatable, ValidationError}; #[cfg(any(feature = "cl", feature = "cl_native"))] pub use anoncreds_clsignatures; +#[cfg(feature = "anoncreds")] /// Type definitions related Indy credential issuance and verification pub mod anoncreds; From 16b0ca4d967845d877b880c0c14037c026f22d0a Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Wed, 2 Aug 2023 16:41:47 -0700 Subject: [PATCH 3/5] add method to validate a merkle tree inclusion proof (for indy-vdr) Signed-off-by: Andrew Whitehead --- indy-data-types/src/merkle_tree/mod.rs | 45 +++++++++++++++++++++++- indy-data-types/src/merkle_tree/proof.rs | 4 +-- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/indy-data-types/src/merkle_tree/mod.rs b/indy-data-types/src/merkle_tree/mod.rs index 44fde87..2126d6f 100644 --- a/indy-data-types/src/merkle_tree/mod.rs +++ b/indy-data-types/src/merkle_tree/mod.rs @@ -3,9 +3,10 @@ use indy_utils::hash::{TreeHash, SHA256::DigestType as Hash}; use self::tree::{Tree, TreeLeafData}; use crate::ValidationError; -mod merkletree; pub use self::merkletree::MerkleTree; +pub use self::proof::Positioned; +mod merkletree; mod proof; mod tree; @@ -199,6 +200,25 @@ impl MerkleTree { } Ok(()) } + + pub fn check_inclusion_proof( + root_hash: &[u8], + leaf_value: &TreeLeafData, + path: &[Positioned], + ) -> Result { + let mut check_hash = Hash::hash_leaf(leaf_value)?; + for node in path { + match node { + Positioned::Left(data) => { + check_hash = Hash::hash_nodes(data, &check_hash)?; + } + Positioned::Right(data) => { + check_hash = Hash::hash_nodes(&check_hash, data)?; + } + } + } + Ok(check_hash == root_hash) + } } #[cfg(test)] @@ -443,4 +463,27 @@ mod tests { .consistency_proof(&full_root_hash, 8, &proofs_for_8) .unwrap()); } + + #[test] + fn check_inclusion_proof_works() { + let nodes = [ + (true, "Gf9aBhHCtBpTYbJXQWnt1DU8q33hwi6nN4f3NhnsBgMZ"), + (false, "68TGAdRjeQ29eNcuFYhsX5uLakGQLgKMKp5wSyPzt9Nq"), + (true, "25KLEkkyCEPSBj4qMFE3AcH87mFocyJEuPJ5xzPGwDgz"), + ]; + let path: Vec>> = nodes + .iter() + .map(|(side, val)| { + let val = base58::decode(val).unwrap(); + if *side { + Positioned::Right(val) + } else { + Positioned::Left(val) + } + }) + .collect(); + let root_hash = base58::decode("CrA5sqYe3ruf2uY7d8re7ePmyHqptHqANtMZcfZd4BvK").unwrap(); + let leaf_value = b"\x81\xa13\xa13".to_vec(); // {"3":"3"} serialized via rmp + assert!(MerkleTree::check_inclusion_proof(&root_hash, &leaf_value, &path).unwrap()); + } } diff --git a/indy-data-types/src/merkle_tree/proof.rs b/indy-data-types/src/merkle_tree/proof.rs index ed798f9..84afa3a 100644 --- a/indy-data-types/src/merkle_tree/proof.rs +++ b/indy-data-types/src/merkle_tree/proof.rs @@ -46,13 +46,13 @@ impl Proof { Some(Positioned::Left(ref hash)) => { let combined = Hash::hash_nodes(hash, &sub.node_hash)?; - let hashes_match = combined.to_vec().as_slice() == lemma.node_hash.as_slice(); + let hashes_match = combined == lemma.node_hash; Ok(hashes_match && self.validate_lemma(sub)?) } Some(Positioned::Right(ref hash)) => { let combined = Hash::hash_nodes(&sub.node_hash, hash)?; - let hashes_match = combined.to_vec().as_slice() == lemma.node_hash.as_slice(); + let hashes_match = combined == lemma.node_hash; Ok(hashes_match && self.validate_lemma(sub)?) } }, From 1443693159ee69c240eb8f3f8cd719901c3700b8 Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Wed, 2 Aug 2023 16:47:25 -0700 Subject: [PATCH 4/5] move hash module to merkle tree implementation Signed-off-by: Andrew Whitehead --- indy-data-types/Cargo.toml | 4 +++- {indy-utils/src => indy-data-types/src/merkle_tree}/hash.rs | 4 ++-- indy-data-types/src/merkle_tree/merkletree.rs | 3 +-- indy-data-types/src/merkle_tree/mod.rs | 4 ++-- indy-data-types/src/merkle_tree/proof.rs | 3 +-- indy-data-types/src/merkle_tree/tree.rs | 3 +-- indy-utils/Cargo.toml | 3 +-- indy-utils/src/lib.rs | 4 ---- 8 files changed, 11 insertions(+), 17 deletions(-) rename {indy-utils/src => indy-data-types/src/merkle_tree}/hash.rs (97%) diff --git a/indy-data-types/Cargo.toml b/indy-data-types/Cargo.toml index 77c2319..2bdb1a0 100644 --- a/indy-data-types/Cargo.toml +++ b/indy-data-types/Cargo.toml @@ -20,7 +20,7 @@ default = ["anoncreds", "merkle_tree"] anoncreds = ["serde_support"] cl = ["anoncreds", "anoncreds-clsignatures", "serde_support"] cl_native = ["anoncreds", "anoncreds-clsignatures/openssl_bn", "serde_support"] -merkle_tree = ["indy-utils/hash", "hex"] +merkle_tree = ["hex", "sha2"] rich_schema = [] serde_support = [ "serde", @@ -37,8 +37,10 @@ once_cell = "1" regex = "1" serde = { version = "1.0", optional = true, features = ["derive"] } serde_json = { version = "1.0", optional = true, features = ["raw_value"] } +sha2 = { version = "0.10", optional = true } zeroize = { version = "1", features = ["zeroize_derive"] } rmp-serde = "1.0" + [dependencies.indy-utils] version = "0.6" path = "../indy-utils" diff --git a/indy-utils/src/hash.rs b/indy-data-types/src/merkle_tree/hash.rs similarity index 97% rename from indy-utils/src/hash.rs rename to indy-data-types/src/merkle_tree/hash.rs index e162a41..3e18e8c 100644 --- a/indy-utils/src/hash.rs +++ b/indy-data-types/src/merkle_tree/hash.rs @@ -1,13 +1,13 @@ pub use sha2::Digest; -use super::ValidationError; +use crate::ValidationError; /// Derive a new hash type #[macro_export] macro_rules! hash_type { ($modname:ident, $digest:path, $doc:expr) => { #[doc=$doc] - #[allow(non_snake_case)] + #[allow(non_snake_case, unused)] pub mod $modname { use once_cell::sync::Lazy; use sha2::Digest; diff --git a/indy-data-types/src/merkle_tree/merkletree.rs b/indy-data-types/src/merkle_tree/merkletree.rs index da89d4b..d6ebc47 100644 --- a/indy-data-types/src/merkle_tree/merkletree.rs +++ b/indy-data-types/src/merkle_tree/merkletree.rs @@ -1,8 +1,7 @@ -use indy_utils::hash::{ +use super::hash::{ TreeHash, SHA256::{digest_empty, DigestType as Hash}, }; - use super::proof::{Lemma, Proof}; use super::tree::{LeavesIntoIterator, LeavesIterator, Tree, TreeLeafData}; use crate::ValidationError; diff --git a/indy-data-types/src/merkle_tree/mod.rs b/indy-data-types/src/merkle_tree/mod.rs index 2126d6f..b2669a1 100644 --- a/indy-data-types/src/merkle_tree/mod.rs +++ b/indy-data-types/src/merkle_tree/mod.rs @@ -1,11 +1,11 @@ -use indy_utils::hash::{TreeHash, SHA256::DigestType as Hash}; - +use self::hash::{TreeHash, SHA256::DigestType as Hash}; use self::tree::{Tree, TreeLeafData}; use crate::ValidationError; pub use self::merkletree::MerkleTree; pub use self::proof::Positioned; +mod hash; mod merkletree; mod proof; mod tree; diff --git a/indy-data-types/src/merkle_tree/proof.rs b/indy-data-types/src/merkle_tree/proof.rs index 84afa3a..f2c38a5 100644 --- a/indy-data-types/src/merkle_tree/proof.rs +++ b/indy-data-types/src/merkle_tree/proof.rs @@ -1,5 +1,4 @@ -use indy_utils::hash::{TreeHash, SHA256::DigestType as Hash}; - +use super::hash::{TreeHash, SHA256::DigestType as Hash}; use super::tree::{Tree, TreeLeafData}; use crate::ValidationError; diff --git a/indy-data-types/src/merkle_tree/tree.rs b/indy-data-types/src/merkle_tree/tree.rs index 551aa7d..2cb46bf 100644 --- a/indy-data-types/src/merkle_tree/tree.rs +++ b/indy-data-types/src/merkle_tree/tree.rs @@ -1,7 +1,6 @@ use std::cmp; -use indy_utils::hash::{TreeHash, SHA256::DigestType as Hash}; - +use super::hash::{TreeHash, SHA256::DigestType as Hash}; use crate::ValidationError; pub type TreeLeafData = Vec; diff --git a/indy-utils/Cargo.toml b/indy-utils/Cargo.toml index 275b31c..6bf2a70 100644 --- a/indy-utils/Cargo.toml +++ b/indy-utils/Cargo.toml @@ -16,9 +16,8 @@ path = "src/lib.rs" crate-type = ["rlib"] [features] -default = ["ed25519", "hash"] +default = ["ed25519"] ed25519 = ["curve25519-dalek", "ed25519-dalek", "rand", "sha2", "x25519-dalek"] -hash = ["sha2"] [dependencies] bs58 = "0.5" diff --git a/indy-utils/src/lib.rs b/indy-utils/src/lib.rs index 8b92c9c..aed6b2b 100644 --- a/indy-utils/src/lib.rs +++ b/indy-utils/src/lib.rs @@ -27,7 +27,3 @@ pub mod did; /// Indy signing keys and verification keys pub mod keys; - -/// Hash algorithms -#[cfg(feature = "hash")] -pub mod hash; From 6ff1c31812fe9ebcdfdd3363d75148a8722520be Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Wed, 2 Aug 2023 16:52:46 -0700 Subject: [PATCH 5/5] update dependencies Signed-off-by: Andrew Whitehead --- indy-credx/Cargo.toml | 16 +++++----------- indy-credx/src/services/helpers.rs | 4 ++-- indy-data-types/Cargo.toml | 7 +------ 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/indy-credx/Cargo.toml b/indy-credx/Cargo.toml index 4a8c657..01cfa34 100644 --- a/indy-credx/Cargo.toml +++ b/indy-credx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "indy-credx" -version = "1.0.0" +version = "1.0.1" authors = ["Hyperledger Indy Contributors "] description = "Verifiable credential issuance and presentation for Hyperledger Indy (https://www.hyperledger.org/projects), which provides a distributed-ledger-based foundation for self-sovereign identity (https://sovrin.org)." edition = "2021" @@ -25,6 +25,10 @@ vendored = ["indy-data-types/vendored"] [dependencies] env_logger = { version = "0.10", optional = true } ffi-support = { version = "0.4.0", optional = true } +indy-data-types = { version = "0.6.1", features = [ + "cl_native", +], path = "../indy-data-types" } +indy-utils = { version = "0.6.0", default-features = false, path = "../indy-utils" } log = "0.4" once_cell = "1" rand = "0.8" @@ -34,13 +38,3 @@ serde_json = "1.0" sha2 = "0.10" thiserror = "1.0" zeroize = { version = "1", optional = true } - -[dependencies.indy-data-types] -version = "0.6" -path = "../indy-data-types" -features = ["cl_native"] - -[dependencies.indy-utils] -version = "0.5" -path = "../indy-utils" -default-features = false diff --git a/indy-credx/src/services/helpers.rs b/indy-credx/src/services/helpers.rs index aa7ba94..8d28c25 100644 --- a/indy-credx/src/services/helpers.rs +++ b/indy-credx/src/services/helpers.rs @@ -8,7 +8,7 @@ use indy_data_types::anoncreds::{ use crate::anoncreds_clsignatures::{ hash_credential_attribute, CredentialSchema, CredentialValues as ClCredentialValues, - Issuer as ClIssuer, MasterSecret as ClMasterSecret, NonCredentialSchema, SubProofRequest, + Issuer as ClIssuer, LinkSecret as ClLinkSecret, NonCredentialSchema, SubProofRequest, Verifier as ClVerifier, }; use crate::error::Result; @@ -45,7 +45,7 @@ pub fn build_non_credential_schema() -> Result { pub fn build_credential_values( credential_values: &HashMap, - link_secret: Option<&ClMasterSecret>, + link_secret: Option<&ClLinkSecret>, ) -> Result { trace!( "build_credential_values >>> credential_values: {:?}", diff --git a/indy-data-types/Cargo.toml b/indy-data-types/Cargo.toml index 2bdb1a0..d4bfa4a 100644 --- a/indy-data-types/Cargo.toml +++ b/indy-data-types/Cargo.toml @@ -32,6 +32,7 @@ vendored = ["anoncreds-clsignatures?/openssl_vendored"] [dependencies] anoncreds-clsignatures = { version = "0.2", optional = true } +indy-utils = { version = "0.6.0", default-features = false, path = "../indy-utils" } hex = { version = "0.4", optional = true } once_cell = "1" regex = "1" @@ -39,12 +40,6 @@ serde = { version = "1.0", optional = true, features = ["derive"] } serde_json = { version = "1.0", optional = true, features = ["raw_value"] } sha2 = { version = "0.10", optional = true } zeroize = { version = "1", features = ["zeroize_derive"] } -rmp-serde = "1.0" - -[dependencies.indy-utils] -version = "0.6" -path = "../indy-utils" -default-features = false [dev-dependencies] hex = "0.4"