Add decoding error type to VerificationError enum
This commit is contained in:
parent
75fa39718c
commit
49dc82fb0a
1 changed files with 5 additions and 2 deletions
|
@ -35,6 +35,9 @@ pub enum VerificationError {
|
|||
#[error("invalid key")]
|
||||
InvalidKey(#[from] rsa::pkcs8::Error),
|
||||
|
||||
#[error("invalid encoding")]
|
||||
InvalidEncoding(#[from] base64::DecodeError),
|
||||
|
||||
#[error("invalid signature")]
|
||||
InvalidSignature,
|
||||
}
|
||||
|
@ -142,10 +145,10 @@ pub async fn verify_http_signature(
|
|||
&public_key,
|
||||
&signature_data.message,
|
||||
&signature_data.signature,
|
||||
).map_err(|_| VerificationError::InvalidSignature)?;
|
||||
)?;
|
||||
if !is_valid_signature {
|
||||
return Err(VerificationError::InvalidSignature);
|
||||
}
|
||||
};
|
||||
let signer_id = actor_profile.actor_id(&config.instance_url());
|
||||
Ok(signer_id)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue