1
0
Fork 0
forked from alemi/upub

fix: temporary extra debug to fix iceshrimp

This commit is contained in:
əlemi 2024-06-29 16:50:31 +02:00
parent a614f7c35b
commit 3fbff70933
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -116,6 +116,7 @@ where
.get("Signature") .get("Signature")
.map(|v| v.to_str().unwrap_or("")) .map(|v| v.to_str().unwrap_or(""))
{ {
tracing::debug!("validating http signature '{sig}'");
let mut http_signature = HttpSignature::parse(sig); let mut http_signature = HttpSignature::parse(sig);
// TODO assert payload's digest is equal to signature's // TODO assert payload's digest is equal to signature's
@ -132,9 +133,9 @@ where
Err(PullError::Database(x)) => return Err(PullError::Database(x).into()), Err(PullError::Database(x)) => return Err(PullError::Database(x).into()),
Err(e) => tracing::debug!("could not fetch {user_id} to verify signature: {e}"), Err(e) => tracing::debug!("could not fetch {user_id} to verify signature: {e}"),
Ok(user) => { Ok(user) => {
let valid = http_signature let signature = http_signature.build_from_parts(parts);
.build_from_parts(parts) tracing::debug!("constructed http signature {signature:?}");
.verify(&user.public_key)?; let valid = signature.verify(&user.public_key)?;
if !valid { if !valid {
tracing::warn!("refusing mismatching http signature"); tracing::warn!("refusing mismatching http signature");