summaryrefslogtreecommitdiffstats
path: root/vendor/signature/src
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /vendor/signature/src
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/signature/src')
-rw-r--r--vendor/signature/src/error.rs13
-rw-r--r--vendor/signature/src/lib.rs18
2 files changed, 17 insertions, 14 deletions
diff --git a/vendor/signature/src/error.rs b/vendor/signature/src/error.rs
index 1bfaf33bf..6518f17b8 100644
--- a/vendor/signature/src/error.rs
+++ b/vendor/signature/src/error.rs
@@ -93,6 +93,19 @@ impl From<Box<dyn std::error::Error + Send + Sync + 'static>> for Error {
}
}
+#[cfg(feature = "rand_core")]
+impl From<rand_core::Error> for Error {
+ #[cfg(not(feature = "std"))]
+ fn from(_source: rand_core::Error) -> Error {
+ Error::new()
+ }
+
+ #[cfg(feature = "std")]
+ fn from(source: rand_core::Error) -> Error {
+ Error::from_source(source)
+ }
+}
+
#[cfg(feature = "std")]
impl std::error::Error for Error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
diff --git a/vendor/signature/src/lib.rs b/vendor/signature/src/lib.rs
index ba1feb494..c90f5cc8a 100644
--- a/vendor/signature/src/lib.rs
+++ b/vendor/signature/src/lib.rs
@@ -92,13 +92,12 @@
//! and compiler errors, and in our experience makes them unsuitable for this
//! sort of API. We believe such an API is the natural one for signature
//! systems, reflecting the natural way they are written absent a trait.
-//! - Associated types preclude multiple (or generic) implementations of the
-//! same trait. These parameters are common in signature systems, notably
-//! ones which support different digest algorithms.
+//! - Associated types preclude multiple implementations of the same trait.
+//! These parameters are common in signature systems, notably ones which
+//! support different serializations of a signature (e.g. raw vs ASN.1).
//! - Digital signatures are almost always larger than the present 32-entry
-//! trait impl limitation on array types, which complicates trait signatures
+//! trait impl limitation on array types, which complicates bounds
//! for these types (particularly things like `From` or `Borrow` bounds).
-//! This may be more interesting to explore after const generics.
//!
//! ## Unstable features
//!
@@ -111,15 +110,6 @@
//!
//! The following unstable features are presently supported:
//!
-//! - `derive`: for implementers of signature systems using [`DigestSigner`]
-//! and [`DigestVerifier`], the `derive` feature can be used to
-//! derive [`Signer`] and [`Verifier`] traits which prehash the input
-//! message using the [`PrehashSignature::Digest`] algorithm for
-//! a given signature type. When the `derive` feature is enabled
-//! import the proc macros with `use signature::{Signer, Verifier}` and then
-//! add a `derive(Signer)` or `derive(Verifier)` attribute to the given
-//! digest signer/verifier type. Enabling this feature also enables `digest`
-//! support (see immediately below).
//! - `digest`: enables the [`DigestSigner`] and [`DigestVerifier`]
//! traits which are based on the [`Digest`] trait from the [`digest`] crate.
//! These traits are used for representing signature systems based on the