Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .jules/sentinel.md
Empty file.
5 changes: 3 additions & 2 deletions crates/gitlawb-attest/src/attestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//! by exact match.

use base64::{engine::general_purpose::URL_SAFE_NO_PAD as B64U, Engine};
use ed25519_dalek::{Signature, Signer, SigningKey, Verifier, VerifyingKey};
use ed25519_dalek::{Signature, Signer, SigningKey, VerifyingKey};
use serde::{de::DeserializeOwned, Deserialize, Serialize};

use crate::error::{Error, Result};
Expand Down Expand Up @@ -111,7 +111,8 @@ impl Attestation {
.try_into()
.map_err(|_| Error::Signature("signature must be 64 bytes".to_string()))?;
let sig = Signature::from_bytes(&sig_bytes);
vk.verify(&bytes, &sig)
// Sentinel: Use verify_strict to prevent signature malleability (strict RFC 8032 compliance)
vk.verify_strict(&bytes, &sig)
.map_err(|e| Error::Signature(format!("ed25519: {e}")))?;

Ok(vk)
Expand Down
5 changes: 3 additions & 2 deletions crates/gitlawb-core/src/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ impl Keypair {

/// Verify an Ed25519 signature.
pub fn verify(verifying_key: &VerifyingKey, msg: &[u8], sig_bytes: &[u8; 64]) -> Result<()> {
use ed25519_dalek::Verifier;

let sig = Signature::from_bytes(sig_bytes);
// Sentinel: Use verify_strict to prevent signature malleability (strict RFC 8032 compliance)
verifying_key
.verify(msg, &sig)
.verify_strict(msg, &sig)
.map_err(|_| Error::SignatureInvalid)
}

Expand Down
Loading