Skip to content

Commit b856788

Browse files
committed
Fix VEX to reject Maven entries with uncertain property declarations
entry_wired_checked returns Ok(false) when attestable_checked detects Maven declarations that may still read the base (unresolved or profile-moved properties). VEX sources must gate on Ok(false) as well as Err, preventing attestation while another module could build the unpatched jar.
1 parent 1d77282 commit b856788

1 file changed

Lines changed: 20 additions & 10 deletions

File tree

‎crates/socket-patch-cli/src/commands/vex_sources.rs‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -464,16 +464,26 @@ pub(crate) async fn plan(
464464
.as_ref()
465465
.filter(|e| socket_patch_core::vendor::jvm::apply::is_jvm_entry(e))
466466
{
467-
if let Err(detail) =
468-
socket_patch_core::vendor::jvm::apply::entry_wired_checked(root, entry)
469-
{
470-
const CODE: &str = "vendor_jvm_shape_unsupported";
471-
gated.push(failed(&cand.key, CODE));
472-
notes.push(note(
473-
CODE,
474-
format!("{}: cannot establish JVM wiring: {detail}", cand.key),
475-
));
476-
continue;
467+
match socket_patch_core::vendor::jvm::apply::entry_wired_checked(root, entry) {
468+
Err(detail) => {
469+
const CODE: &str = "vendor_jvm_shape_unsupported";
470+
gated.push(failed(&cand.key, CODE));
471+
notes.push(note(
472+
CODE,
473+
format!("{}: cannot establish JVM wiring: {detail}", cand.key),
474+
));
475+
continue;
476+
}
477+
Ok(false) => {
478+
const CODE: &str = "vendor_jvm_uncertain";
479+
gated.push(failed(&cand.key, CODE));
480+
notes.push(note(
481+
CODE,
482+
format!("{}: Maven declaration may still read the base", cand.key),
483+
));
484+
continue;
485+
}
486+
Ok(true) => {}
477487
}
478488
}
479489
let basis = if let Some(vref) = cand

0 commit comments

Comments
 (0)