Skip to content

Commit

Permalink
fix: For Issue 672, Callback is unsound (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpeacock authored Nov 14, 2024
1 parent 32c2460 commit b190464
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdk/src/callback_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::{
/// The callback should return a signature for the given data.
/// The callback should return an error if the data cannot be signed.
pub type CallbackFunc =
dyn Fn(*const (), &[u8]) -> std::result::Result<Vec<u8>, Error>;
dyn Fn(*const (), &[u8]) -> std::result::Result<Vec<u8>, Error> + Send + Sync;

/// Defines a signer that uses a callback to sign data.
///
Expand Down Expand Up @@ -59,7 +59,7 @@ impl CallbackSigner {
/// Create a new callback signer.
pub fn new<F, T>(callback: F, alg: SigningAlg, certs: T) -> Self
where
F: Fn(*const (), &[u8]) -> std::result::Result<Vec<u8>, Error> + 'static,
F: Fn(*const (), &[u8]) -> std::result::Result<Vec<u8>, Error> + Send + Sync + 'static,
T: Into<Vec<u8>>,
{
let certs = certs.into();
Expand Down

0 comments on commit b190464

Please sign in to comment.