Skip to content

Commit

Permalink
Merge pull request #379 from sigstore/dependabot/cargo/cached-0.53.1
Browse files Browse the repository at this point in the history
build(deps): update cached requirement from 0.52.0 to 0.53.1
  • Loading branch information
flavio authored Aug 5, 2024
2 parents fd2968e + e84fb64 commit 7468881
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ cached-client = ["cached"]
[dependencies]
async-trait = "0.1.52"
base64 = "0.22.0"
cached = { version = "0.52.0", optional = true, features = ["async"] }
cached = { version = "0.53.1", optional = true, features = ["async"] }
cfg-if = "1.0.0"
chrono = { version = "0.4.27", default-features = false, features = [
"now",
Expand Down
4 changes: 2 additions & 2 deletions examples/openidflow/openidconnect/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ fn main() -> Result<(), anyhow::Error> {

match result {
Ok((token_response, id_token)) => {
println!("Email {:?}", token_response.email().unwrap().to_string());
println!("Email {:?}", token_response.email().unwrap());
println!(
"Access Token:{:?}",
token_response.access_token_hash().unwrap().to_string()
token_response.access_token_hash().unwrap()
);
println!("id_token: {:?}", id_token.to_string());
}
Expand Down
3 changes: 1 addition & 2 deletions src/cosign/payload/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

//! This module defines different kinds of payload to be signed
//! in cosign. Now it supports:
//! * `SimpleSigning`: Refer to
//! <https://github.com/containers/image/blob/a5061e5a5f00333ea3a92e7103effd11c6e2f51d/docs/containers-signature.5.md#json-data-format>
//! * `SimpleSigning`: Refer to <https://github.com/containers/image/blob/a5061e5a5f00333ea3a92e7103effd11c6e2f51d/docs/containers-signature.5.md#json-data-format>

pub mod simple_signing;
pub use simple_signing::SimpleSigning;
26 changes: 13 additions & 13 deletions src/crypto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@ pub use verification_key::CosignVerificationKey;

/// Different digital signature algorithms.
/// * `RSA_PSS_SHA256`: RSA PSS padding using SHA-256
/// for RSA signatures. All the `usize` member inside
/// an RSA enum represents the key size of the RSA key.
/// for RSA signatures. All the `usize` member inside
/// an RSA enum represents the key size of the RSA key.
/// * `RSA_PSS_SHA384`: RSA PSS padding using SHA-384
/// for RSA signatures.
/// for RSA signatures.
/// * `RSA_PSS_SHA512`: RSA PSS padding using SHA-512
/// for RSA signatures.
/// for RSA signatures.
/// * `RSA_PKCS1_SHA256`: PKCS#1 1.5 padding using
/// SHA-256 for RSA signatures.
/// SHA-256 for RSA signatures.
/// * `RSA_PKCS1_SHA384`: PKCS#1 1.5 padding using
/// SHA-384 for RSA signatures.
/// SHA-384 for RSA signatures.
/// * `RSA_PKCS1_SHA512`: PKCS#1 1.5 padding using
/// SHA-512 for RSA signatures.
/// SHA-512 for RSA signatures.
/// * `ECDSA_P256_SHA256_ASN1`: ASN.1 DER-encoded ECDSA
/// signatures using the P-256 curve and SHA-256. It
/// is the default signing scheme.
/// signatures using the P-256 curve and SHA-256. It
/// is the default signing scheme.
/// * `ECDSA_P384_SHA384_ASN1`: ASN.1 DER-encoded ECDSA
/// signatures using the P-384 curve and SHA-384.
/// signatures using the P-384 curve and SHA-384.
/// * `ED25519`: ECDSA signature using SHA2-512
/// as the digest function and curve edwards25519. The
/// signature format please refer
/// to [RFC 8032](https://www.rfc-editor.org/rfc/rfc8032.html#section-5.1.6).
/// as the digest function and curve edwards25519. The
/// signature format please refer
/// to [RFC 8032](https://www.rfc-editor.org/rfc/rfc8032.html#section-5.1.6).
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum SigningScheme {
Expand Down
3 changes: 2 additions & 1 deletion src/crypto/signing_key/ecdsa/ec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
//! The [`ECDSAKeys`] has two enums due to their underlying elliptic curves, s.t.
//! * `P256`
//! * `P384`
//!
//! To have an uniform interface for all kinds of asymmetric keys, [`ECDSAKeys`]
//! is also wrapped in [`super::super::SigStoreKeyPair`] enum.
//!
Expand Down Expand Up @@ -483,7 +484,7 @@ mod tests {
/// This test will do the following things:
/// * Generate a ecdsa-P256 keypair.
/// * Sign the MESSAGE with the private key and digest algorithm SHA256,
/// then generate a signature.
/// then generate a signature.
/// * Verify the signature using the public key.
#[test]
fn ecdsa_sign_and_verify() {
Expand Down
6 changes: 3 additions & 3 deletions src/crypto/signing_key/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
//! * [`SigStoreSigner::RSA_PKCS1_SHA384`]: RSA signatures using PKCS#1v1.5 padding and SHA-384.
//! * [`SigStoreSigner::RSA_PKCS1_SHA512`]: RSA signatures using PKCS#1v1.5 padding and SHA-512.
//! * [`SigStoreSigner::ECDSA_P256_SHA256_ASN1`]: ASN.1 DER-encoded ECDSA
//! signatures using the P-256 curve and SHA-256.
//! signatures using the P-256 curve and SHA-256.
//! * [`SigStoreSigner::ECDSA_P384_SHA384_ASN1`]: ASN.1 DER-encoded ECDSA
//! signatures using the P-384 curve and SHA-384.
//! signatures using the P-384 curve and SHA-384.
//! * [`SigStoreSigner::ED25519`]: ECDSA signature using SHA2-512
//! as the digest function and curve edwards25519.
//! as the digest function and curve edwards25519.
//!
//! # Simple Usages
//!
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/signing_key/rsa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub enum DigestAlgorithm {
/// RSA-based signing algorithm.
/// * `PSS`: Probabilistic Signature Scheme, more secure than `PKCS1v15`.
/// * `PKCS1v15`: also known as simply PKCS1, is a simple padding
/// scheme developed for use with RSA keys.
/// scheme developed for use with RSA keys.
pub enum PaddingScheme {
PSS,
PKCS1v15,
Expand Down
8 changes: 4 additions & 4 deletions src/crypto/transparency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@ MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiPSlFi0CmFTfEjCUqF9HuCEcYXNK
AaYalIJmBZ8yyezPjTqhxrKBpMnaocVtLJBI1eM3uXnQzQGAJdJ4gs9Fyw==
-----END PUBLIC KEY-----"#;

let cert = Certificate::from_pem(&cert_pem).unwrap();
let chain = chain_pem.map(|c| Certificate::from_pem(&c).unwrap());
let cert = Certificate::from_pem(cert_pem).unwrap();
let chain = chain_pem.map(|c| Certificate::from_pem(c).unwrap());
let sct = CertificateEmbeddedSCT::new(&cert, &chain).unwrap();
let ctfe_key: VerifyingKey = VerifyingKey::from_str(&ctfe_pem).unwrap();
let ctfe_key: VerifyingKey = VerifyingKey::from_str(ctfe_pem).unwrap();
let keyring = Keyring::new([ctfe_key.to_public_key_der().unwrap().as_bytes()]).unwrap();

assert!(verify_sct(&sct, &keyring).is_ok());
Expand All @@ -391,7 +391,7 @@ mnuk5d670MTXR3p+LIAcxd5MhqIHpLmyYJ5mDKLEoZ/pC0nPuje3JueBcA==
-----END PUBLIC KEY-----"#;

let sct: SigningCertificateDetachedSCT = serde_json::from_str(sct_json).unwrap();
let ctfe_key: VerifyingKey = VerifyingKey::from_str(&ctfe_pem).unwrap();
let ctfe_key: VerifyingKey = VerifyingKey::from_str(ctfe_pem).unwrap();
let keyring = Keyring::new([ctfe_key.to_public_key_der().unwrap().as_bytes()]).unwrap();

assert!(verify_sct(&sct, &keyring).is_ok());
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,18 @@
//!
//! - `default`: Enables `full-native-tls`, `cached-client` and `test-registry` features.
//! - `full-native-tls`: Enables support for `fulcio`, `rekor` and `cosign`. All the underlying
//! tls uses `native-tls`. This feature will not enable `test-registry.`
//! tls uses `native-tls`. This feature will not enable `test-registry.`
//! - `full-rustls-tls`: Enables support for `fulcio`, `rekor` and `cosign`. All the underlying
//! tls uses `rustls-tls`. This feature will not enable `test-registry.`
//! tls uses `rustls-tls`. This feature will not enable `test-registry.`
//!
//! - `fulcio-native-tls` and `fulcio-rustls-tls`: Enables support for `fulcio`, but one uses
//! `native-tls` as underlying tls and the other uses `rustls-tls`.
//! `native-tls` as underlying tls and the other uses `rustls-tls`.
//!
//! - `rekor-native-tls` and `rekor-rustls-tls`: Enables support for `rekor`, but one uses
//! `native-tls` as underlying tls and the other uses `rustls-tls`.
//! `native-tls` as underlying tls and the other uses `rustls-tls`.
//!
//! - `cosign-native-tls` and `cosign-rustls-tls`: Enables support for `cosign`, but one uses
//! `native-tls` as underlying tls and the other uses `rustls-tls`.
//! `native-tls` as underlying tls and the other uses `rustls-tls`.
//!
//! - `cached-client`: Enables support for OCI registry client caching.
//!
Expand Down
8 changes: 4 additions & 4 deletions src/oauth/openidflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
//! The `auth_url` function returns the following:
//!
//! - `authorize_url` is a URL that can be opened in a browser. The user will be
//! prompted to login and authorize the application. The user will be redirected to
//! the `redirect_uri` URL with a code parameter.
//! prompted to login and authorize the application. The user will be redirected to
//! the `redirect_uri` URL with a code parameter.
//!
//! - `client` is a client object that can be used to make requests to the OpenID
//! Connect server.
//! Connect server.
//!
//! - `nonce` is a random value that is used to prevent replay attacks.
//!
//! - `pkce_verifier` is a PKCE verifier that can be used to generate the code_verifier
//! value.
//! value.
//!
//! Once you have recieved the above tuple, you can use the [`RedirectListener::redirect_listener`](RedirectListener::redirect_listener)
//! function to get the ID Token and scope.
Expand Down

0 comments on commit 7468881

Please sign in to comment.