From 7125d497088f49cf1ace3664566972fa08d34180 Mon Sep 17 00:00:00 2001 From: Nathaniel McCallum Date: Wed, 14 Sep 2022 14:49:54 -0400 Subject: [PATCH 1/2] chore(b64): add MIT as an acceptable license in the SPDX header Signed-off-by: Nathaniel McCallum --- jose/src/alg.rs | 2 +- jose/src/b64/bytes.rs | 2 +- jose/src/b64/codec/dec.rs | 2 +- jose/src/b64/codec/enc.rs | 2 +- jose/src/b64/codec/mod.rs | 2 +- jose/src/b64/json.rs | 2 +- jose/src/b64/mod.rs | 2 +- jose/src/b64/optional.rs | 2 +- jose/src/b64/secret.rs | 2 +- jose/src/jwk/crypto/mod.rs | 2 +- jose/src/jwk/crypto/rcrypto/key.rs | 2 +- jose/src/jwk/crypto/rcrypto/mod.rs | 2 +- jose/src/jwk/crypto/rcrypto/p256.rs | 2 +- jose/src/jwk/crypto/rcrypto/p384.rs | 2 +- jose/src/jwk/crypto/rcrypto/rsa.rs | 2 +- jose/src/jwk/key/ec.rs | 2 +- jose/src/jwk/key/mod.rs | 2 +- jose/src/jwk/key/oct.rs | 2 +- jose/src/jwk/key/okp.rs | 2 +- jose/src/jwk/key/rsa.rs | 2 +- jose/src/jwk/mod.rs | 2 +- jose/src/jwk/prm.rs | 2 +- jose/src/jws/crypto/core.rs | 2 +- jose/src/jws/crypto/mod.rs | 2 +- jose/src/jws/crypto/rcrypto/hmac.rs | 2 +- jose/src/jws/crypto/rcrypto/key.rs | 2 +- jose/src/jws/crypto/rcrypto/mod.rs | 2 +- jose/src/jws/crypto/rcrypto/p256.rs | 2 +- jose/src/jws/crypto/rcrypto/p384.rs | 2 +- jose/src/jws/crypto/rcrypto/rsa.rs | 2 +- jose/src/jws/crypto/rcrypto/state/mod.rs | 2 +- jose/src/jws/crypto/rcrypto/state/sig.rs | 2 +- jose/src/jws/crypto/rcrypto/state/ver.rs | 2 +- jose/src/jws/crypto/sig.rs | 2 +- jose/src/jws/head.rs | 2 +- jose/src/jws/mod.rs | 2 +- jose/src/key/mod.rs | 2 +- jose/src/key/rcrypto/key.rs | 2 +- jose/src/key/rcrypto/mod.rs | 2 +- jose/src/key/rcrypto/oct.rs | 2 +- jose/src/key/rcrypto/p256.rs | 2 +- jose/src/key/rcrypto/p384.rs | 2 +- jose/src/key/rcrypto/rsa.rs | 2 +- jose/src/lib.rs | 2 +- jose/src/x5t.rs | 2 +- 45 files changed, 45 insertions(+), 45 deletions(-) diff --git a/jose/src/alg.rs b/jose/src/alg.rs index c40be3c..2f268f4 100644 --- a/jose/src/alg.rs +++ b/jose/src/alg.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! IANA-Defined Algorithms diff --git a/jose/src/b64/bytes.rs b/jose/src/b64/bytes.rs index ec470b0..764690a 100644 --- a/jose/src/b64/bytes.rs +++ b/jose/src/b64/bytes.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use alloc::boxed::Box; use alloc::string::String; diff --git a/jose/src/b64/codec/dec.rs b/jose/src/b64/codec/dec.rs index 9da178a..df5a67e 100644 --- a/jose/src/b64/codec/dec.rs +++ b/jose/src/b64/codec/dec.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use core::convert::Infallible; use core::marker::PhantomData; diff --git a/jose/src/b64/codec/enc.rs b/jose/src/b64/codec/enc.rs index d58faaf..f908ce7 100644 --- a/jose/src/b64/codec/enc.rs +++ b/jose/src/b64/codec/enc.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use core::marker::PhantomData; use zeroize::Zeroizing; diff --git a/jose/src/b64/codec/mod.rs b/jose/src/b64/codec/mod.rs index a361a81..e2b6e6b 100644 --- a/jose/src/b64/codec/mod.rs +++ b/jose/src/b64/codec/mod.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT mod dec; mod enc; diff --git a/jose/src/b64/json.rs b/jose/src/b64/json.rs index 663c5ef..d5e24cf 100644 --- a/jose/src/b64/json.rs +++ b/jose/src/b64/json.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg(feature = "jws")] diff --git a/jose/src/b64/mod.rs b/jose/src/b64/mod.rs index f56b5e5..a806324 100644 --- a/jose/src/b64/mod.rs +++ b/jose/src/b64/mod.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! Base64 Conversion Utilities diff --git a/jose/src/b64/optional.rs b/jose/src/b64/optional.rs index 840e0f6..8d4e852 100644 --- a/jose/src/b64/optional.rs +++ b/jose/src/b64/optional.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use super::{Config, Encoder, Update, UrlSafe}; diff --git a/jose/src/b64/secret.rs b/jose/src/b64/secret.rs index 783923e..f6f6a09 100644 --- a/jose/src/b64/secret.rs +++ b/jose/src/b64/secret.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use alloc::boxed::Box; use core::fmt::Debug; diff --git a/jose/src/jwk/crypto/mod.rs b/jose/src/jwk/crypto/mod.rs index 8c6909f..9a1b9a6 100644 --- a/jose/src/jwk/crypto/mod.rs +++ b/jose/src/jwk/crypto/mod.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JWK Cryptographic Implementation diff --git a/jose/src/jwk/crypto/rcrypto/key.rs b/jose/src/jwk/crypto/rcrypto/key.rs index e3e221c..6c76e17 100644 --- a/jose/src/jwk/crypto/rcrypto/key.rs +++ b/jose/src/jwk/crypto/rcrypto/key.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use super::super::super::*; use crate::key::rcrypto::{Key, Type}; diff --git a/jose/src/jwk/crypto/rcrypto/mod.rs b/jose/src/jwk/crypto/rcrypto/mod.rs index 01e1a50..6cdb998 100644 --- a/jose/src/jwk/crypto/rcrypto/mod.rs +++ b/jose/src/jwk/crypto/rcrypto/mod.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JWK integrations with RustCrypto types diff --git a/jose/src/jwk/crypto/rcrypto/p256.rs b/jose/src/jwk/crypto/rcrypto/p256.rs index 74bdc4b..93feb3c 100644 --- a/jose/src/jwk/crypto/rcrypto/p256.rs +++ b/jose/src/jwk/crypto/rcrypto/p256.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg(feature = "p256")] diff --git a/jose/src/jwk/crypto/rcrypto/p384.rs b/jose/src/jwk/crypto/rcrypto/p384.rs index 6e67936..6df3937 100644 --- a/jose/src/jwk/crypto/rcrypto/p384.rs +++ b/jose/src/jwk/crypto/rcrypto/p384.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg(feature = "p384")] diff --git a/jose/src/jwk/crypto/rcrypto/rsa.rs b/jose/src/jwk/crypto/rcrypto/rsa.rs index c1b1cc3..65eddbf 100644 --- a/jose/src/jwk/crypto/rcrypto/rsa.rs +++ b/jose/src/jwk/crypto/rcrypto/rsa.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg(feature = "rsa")] diff --git a/jose/src/jwk/key/ec.rs b/jose/src/jwk/key/ec.rs index f5b6cfa..3521f7b 100644 --- a/jose/src/jwk/key/ec.rs +++ b/jose/src/jwk/key/ec.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JWK elliptic-curve key material. diff --git a/jose/src/jwk/key/mod.rs b/jose/src/jwk/key/mod.rs index 480c66e..573ef56 100644 --- a/jose/src/jwk/key/mod.rs +++ b/jose/src/jwk/key/mod.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JWK key material. diff --git a/jose/src/jwk/key/oct.rs b/jose/src/jwk/key/oct.rs index 62bff62..53eccc2 100644 --- a/jose/src/jwk/key/oct.rs +++ b/jose/src/jwk/key/oct.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JWK symmetric key material. diff --git a/jose/src/jwk/key/okp.rs b/jose/src/jwk/key/okp.rs index 4677add..b4fb8e4 100644 --- a/jose/src/jwk/key/okp.rs +++ b/jose/src/jwk/key/okp.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JWK CFRG-curve key material. diff --git a/jose/src/jwk/key/rsa.rs b/jose/src/jwk/key/rsa.rs index 30cb32e..e4604b2 100644 --- a/jose/src/jwk/key/rsa.rs +++ b/jose/src/jwk/key/rsa.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JWK RSA key material. diff --git a/jose/src/jwk/mod.rs b/jose/src/jwk/mod.rs index 4b5b912..ec50477 100644 --- a/jose/src/jwk/mod.rs +++ b/jose/src/jwk/mod.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JWK: JSON Web Key diff --git a/jose/src/jwk/prm.rs b/jose/src/jwk/prm.rs index ec87493..65ed605 100644 --- a/jose/src/jwk/prm.rs +++ b/jose/src/jwk/prm.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JWK parameter types. diff --git a/jose/src/jws/crypto/core.rs b/jose/src/jws/crypto/core.rs index 987e4dd..000a1d9 100644 --- a/jose/src/jws/crypto/core.rs +++ b/jose/src/jws/crypto/core.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use alloc::vec::Vec; diff --git a/jose/src/jws/crypto/mod.rs b/jose/src/jws/crypto/mod.rs index 15ba595..ccb4dc1 100644 --- a/jose/src/jws/crypto/mod.rs +++ b/jose/src/jws/crypto/mod.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JWS Cryptographic Implementation diff --git a/jose/src/jws/crypto/rcrypto/hmac.rs b/jose/src/jws/crypto/rcrypto/hmac.rs index 40d8660..11ff736 100644 --- a/jose/src/jws/crypto/rcrypto/hmac.rs +++ b/jose/src/jws/crypto/rcrypto/hmac.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg(feature = "hmac")] diff --git a/jose/src/jws/crypto/rcrypto/key.rs b/jose/src/jws/crypto/rcrypto/key.rs index bf2296f..ba724af 100644 --- a/jose/src/jws/crypto/rcrypto/key.rs +++ b/jose/src/jws/crypto/rcrypto/key.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use alloc::boxed::Box; diff --git a/jose/src/jws/crypto/rcrypto/mod.rs b/jose/src/jws/crypto/rcrypto/mod.rs index 90699a0..85c720e 100644 --- a/jose/src/jws/crypto/rcrypto/mod.rs +++ b/jose/src/jws/crypto/rcrypto/mod.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JWS integrations with RustCrypto types diff --git a/jose/src/jws/crypto/rcrypto/p256.rs b/jose/src/jws/crypto/rcrypto/p256.rs index d59f104..d640f57 100644 --- a/jose/src/jws/crypto/rcrypto/p256.rs +++ b/jose/src/jws/crypto/rcrypto/p256.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg(feature = "p256")] diff --git a/jose/src/jws/crypto/rcrypto/p384.rs b/jose/src/jws/crypto/rcrypto/p384.rs index 480e256..715b24e 100644 --- a/jose/src/jws/crypto/rcrypto/p384.rs +++ b/jose/src/jws/crypto/rcrypto/p384.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg(feature = "p384")] diff --git a/jose/src/jws/crypto/rcrypto/rsa.rs b/jose/src/jws/crypto/rcrypto/rsa.rs index 939a727..70c2fb7 100644 --- a/jose/src/jws/crypto/rcrypto/rsa.rs +++ b/jose/src/jws/crypto/rcrypto/rsa.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg(feature = "rsa")] diff --git a/jose/src/jws/crypto/rcrypto/state/mod.rs b/jose/src/jws/crypto/rcrypto/state/mod.rs index 5d42ad3..2ef950d 100644 --- a/jose/src/jws/crypto/rcrypto/state/mod.rs +++ b/jose/src/jws/crypto/rcrypto/state/mod.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT mod sig; mod ver; diff --git a/jose/src/jws/crypto/rcrypto/state/sig.rs b/jose/src/jws/crypto/rcrypto/state/sig.rs index d8a9bf8..0899321 100644 --- a/jose/src/jws/crypto/rcrypto/state/sig.rs +++ b/jose/src/jws/crypto/rcrypto/state/sig.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use alloc::vec::Vec; diff --git a/jose/src/jws/crypto/rcrypto/state/ver.rs b/jose/src/jws/crypto/rcrypto/state/ver.rs index 19f1f22..480c65c 100644 --- a/jose/src/jws/crypto/rcrypto/state/ver.rs +++ b/jose/src/jws/crypto/rcrypto/state/ver.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT #[cfg(feature = "rsa")] use rsa::{Hash, PaddingScheme, PublicKey, RsaPublicKey}; diff --git a/jose/src/jws/crypto/sig.rs b/jose/src/jws/crypto/sig.rs index b41a39e..7d4650b 100644 --- a/jose/src/jws/crypto/sig.rs +++ b/jose/src/jws/crypto/sig.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use alloc::vec::Vec; diff --git a/jose/src/jws/head.rs b/jose/src/jws/head.rs index bd0942c..3980997 100644 --- a/jose/src/jws/head.rs +++ b/jose/src/jws/head.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT pub use crate::x5t::Thumbprint; diff --git a/jose/src/jws/mod.rs b/jose/src/jws/mod.rs index 55e135b..1c1d3d3 100644 --- a/jose/src/jws/mod.rs +++ b/jose/src/jws/mod.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JWS: JSON Web Signature diff --git a/jose/src/key/mod.rs b/jose/src/key/mod.rs index 29b3c34..e1664f7 100644 --- a/jose/src/key/mod.rs +++ b/jose/src/key/mod.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! Cryptographic Key Types diff --git a/jose/src/key/rcrypto/key.rs b/jose/src/key/rcrypto/key.rs index 0b8ab83..8403f29 100644 --- a/jose/src/key/rcrypto/key.rs +++ b/jose/src/key/rcrypto/key.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use crate::alg::Algorithm; diff --git a/jose/src/key/rcrypto/mod.rs b/jose/src/key/rcrypto/mod.rs index 759aac4..8bd0e5c 100644 --- a/jose/src/key/rcrypto/mod.rs +++ b/jose/src/key/rcrypto/mod.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! Integration with RustCrypto types. diff --git a/jose/src/key/rcrypto/oct.rs b/jose/src/key/rcrypto/oct.rs index 728482a..97b46ac 100644 --- a/jose/src/key/rcrypto/oct.rs +++ b/jose/src/key/rcrypto/oct.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use alloc::boxed::Box; use alloc::vec::Vec; diff --git a/jose/src/key/rcrypto/p256.rs b/jose/src/key/rcrypto/p256.rs index d43c71e..ec8af0e 100644 --- a/jose/src/key/rcrypto/p256.rs +++ b/jose/src/key/rcrypto/p256.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg(feature = "p256")] diff --git a/jose/src/key/rcrypto/p384.rs b/jose/src/key/rcrypto/p384.rs index 80948cc..551bf54 100644 --- a/jose/src/key/rcrypto/p384.rs +++ b/jose/src/key/rcrypto/p384.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg(feature = "p384")] diff --git a/jose/src/key/rcrypto/rsa.rs b/jose/src/key/rcrypto/rsa.rs index 09767ee..784f232 100644 --- a/jose/src/key/rcrypto/rsa.rs +++ b/jose/src/key/rcrypto/rsa.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT #![cfg(feature = "rsa")] diff --git a/jose/src/lib.rs b/jose/src/lib.rs index 829b518..e1549d5 100644 --- a/jose/src/lib.rs +++ b/jose/src/lib.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT //! JOSE: JSON Object Signing & Encryption diff --git a/jose/src/x5t.rs b/jose/src/x5t.rs index 65e0bc5..4a78e78 100644 --- a/jose/src/x5t.rs +++ b/jose/src/x5t.rs @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022 Profian Inc. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 OR MIT use crate::b64::Bytes; use serde::{Deserialize, Serialize}; From 60b9550d61968360902a0db1d3ae7098464109a3 Mon Sep 17 00:00:00 2001 From: Nathaniel McCallum Date: Wed, 14 Sep 2022 14:45:17 -0400 Subject: [PATCH 2/2] refactor(jwa): move algorithm types into jose-jwa Signed-off-by: Nathaniel McCallum --- jose-jwa/Cargo.toml | 3 ++ jose-jwa/src/lib.rs | 88 +++++++++++++++++++++++++++++++++++++++++++++ jose/Cargo.toml | 1 + jose/src/alg.rs | 86 +------------------------------------------- jose/src/jwk/prm.rs | 3 +- 5 files changed, 94 insertions(+), 87 deletions(-) diff --git a/jose-jwa/Cargo.toml b/jose-jwa/Cargo.toml index 3f2c421..7fedf11 100644 --- a/jose-jwa/Cargo.toml +++ b/jose-jwa/Cargo.toml @@ -16,6 +16,9 @@ readme = "README.md" edition = "2021" rust-version = "1.63" +[dependencies] +serde = { version = "1.0.136", default-features = false, features = ["alloc", "derive"] } + [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] diff --git a/jose-jwa/src/lib.rs b/jose-jwa/src/lib.rs index 503968a..a57990d 100644 --- a/jose-jwa/src/lib.rs +++ b/jose-jwa/src/lib.rs @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2022 Profian Inc. +// SPDX-License-Identifier: Apache-2.0 OR MIT + #![doc = include_str!("../README.md")] #![no_std] #![cfg_attr(docsrs, feature(doc_cfg))] @@ -15,3 +18,88 @@ unused_lifetimes, unused_qualifications )] + +use serde::{Deserialize, Serialize}; + +/// Algorithms +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[allow(missing_docs)] +#[serde(untagged)] +#[non_exhaustive] +pub enum Algorithm { + Signing(Signing), +} + +impl From for Algorithm { + #[inline(always)] + fn from(alg: Signing) -> Self { + Self::Signing(alg) + } +} + +/// Signing Algorithms +#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum Signing { + /// EdDSA signature algorithms (Optional) + #[serde(rename = "EdDSA")] + EdDsa, + + /// ECDSA using P-256 and SHA-256 (Recommended+) + #[serde(rename = "ES256")] + Es256, + + /// ECDSA using secp256k1 curve and SHA-256 (Optional) + #[serde(rename = "ES256K")] + Es256K, + + /// ECDSA using P-384 and SHA-384 (Optional) + #[serde(rename = "ES384")] + Es384, + + /// ECDSA using P-521 and SHA-512 (Optional) + #[serde(rename = "ES512")] + Es512, + + /// HMAC using SHA-256 (Required) + #[serde(rename = "HS256")] + Hs256, + + /// HMAC using SHA-384 (Optional) + #[serde(rename = "HS384")] + Hs384, + + /// HMAC using SHA-512 (Optional) + #[serde(rename = "HS512")] + Hs512, + + /// RSASSA-PSS using SHA-256 and MGF1 with SHA-256 (Optional) + #[serde(rename = "PS256")] + Ps256, + + /// RSASSA-PSS using SHA-384 and MGF1 with SHA-384 (Optional) + #[serde(rename = "PS384")] + Ps384, + + /// RSASSA-PSS using SHA-512 and MGF1 with SHA-512 (Optional) + #[serde(rename = "PS512")] + Ps512, + + /// RSASSA-PKCS1-v1_5 using SHA-256 (Recommended) + #[serde(rename = "RS256")] + Rs256, + + /// RSASSA-PKCS1-v1_5 using SHA-384 (Optional) + #[serde(rename = "RS384")] + Rs384, + + /// RSASSA-PKCS1-v1_5 using SHA-512 (Optional) + #[serde(rename = "RS512")] + Rs512, + + /// No digital signature or MAC performed (Optional) + /// + /// This variant is renamed as `Null` to avoid colliding with `Option::None`. + #[serde(rename = "none")] + Null, +} diff --git a/jose/Cargo.toml b/jose/Cargo.toml index 3763b6a..c567b56 100644 --- a/jose/Cargo.toml +++ b/jose/Cargo.toml @@ -16,6 +16,7 @@ rsa = ["dep:rand_core", "dep:rsa"] serde = { version = "1.0.136", default-features = false, features = ["alloc", "derive"] } zeroize = { version = "1.5.7", default-features = false, features = ["alloc", "serde"] } subtle = { version = "2.4.1", default-features = false } +jose-jwa = { path = "../jose-jwa" } # Optional Dependencies url = { version = "2.2.2", default-features = false, optional = true, features = ["serde"] } diff --git a/jose/src/alg.rs b/jose/src/alg.rs index 2f268f4..9299ef0 100644 --- a/jose/src/alg.rs +++ b/jose/src/alg.rs @@ -3,88 +3,4 @@ //! IANA-Defined Algorithms -use serde::{Deserialize, Serialize}; - -/// Algorithms -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -#[allow(missing_docs)] -#[serde(untagged)] -#[non_exhaustive] -pub enum Algorithm { - Signing(Signing), - Unknown(alloc::string::String), -} - -impl From for Algorithm { - #[inline(always)] - fn from(alg: Signing) -> Self { - Self::Signing(alg) - } -} - -/// Signing Algorithms -#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -#[non_exhaustive] -pub enum Signing { - /// EdDSA signature algorithms (Optional) - #[serde(rename = "EdDSA")] - EdDsa, - - /// ECDSA using P-256 and SHA-256 (Recommended+) - #[serde(rename = "ES256")] - Es256, - - /// ECDSA using secp256k1 curve and SHA-256 (Optional) - #[serde(rename = "ES256K")] - Es256K, - - /// ECDSA using P-384 and SHA-384 (Optional) - #[serde(rename = "ES384")] - Es384, - - /// ECDSA using P-521 and SHA-512 (Optional) - #[serde(rename = "ES512")] - Es512, - - /// HMAC using SHA-256 (Required) - #[serde(rename = "HS256")] - Hs256, - - /// HMAC using SHA-384 (Optional) - #[serde(rename = "HS384")] - Hs384, - - /// HMAC using SHA-512 (Optional) - #[serde(rename = "HS512")] - Hs512, - - /// RSASSA-PSS using SHA-256 and MGF1 with SHA-256 (Optional) - #[serde(rename = "PS256")] - Ps256, - - /// RSASSA-PSS using SHA-384 and MGF1 with SHA-384 (Optional) - #[serde(rename = "PS384")] - Ps384, - - /// RSASSA-PSS using SHA-512 and MGF1 with SHA-512 (Optional) - #[serde(rename = "PS512")] - Ps512, - - /// RSASSA-PKCS1-v1_5 using SHA-256 (Recommended) - #[serde(rename = "RS256")] - Rs256, - - /// RSASSA-PKCS1-v1_5 using SHA-384 (Optional) - #[serde(rename = "RS384")] - Rs384, - - /// RSASSA-PKCS1-v1_5 using SHA-512 (Optional) - #[serde(rename = "RS512")] - Rs512, - - /// No digital signature or MAC performed (Optional) - /// - /// This variant is renamed as `Null` to avoid colliding with `Option::None`. - #[serde(rename = "none")] - Null, -} +pub use jose_jwa::{Algorithm, Signing}; diff --git a/jose/src/jwk/prm.rs b/jose/src/jwk/prm.rs index 65ed605..ebd687c 100644 --- a/jose/src/jwk/prm.rs +++ b/jose/src/jwk/prm.rs @@ -55,8 +55,7 @@ impl> From for Parameters { let cls = match alg { Some(Algorithm::Signing(..)) => Some(Class::Signing), - Some(Algorithm::Unknown(..)) => None, - None => None, + _ => None, }; Self {