Verified Commit 7e440964 authored by Nadim Kobeissi's avatar Nadim Kobeissi 💎

Don't reconstruct core primitives into attackerState

parent caef3444
Pipeline #552 passed with stages
in 1 minute and 5 seconds
......@@ -17,7 +17,7 @@ var primitiveCoreSpecs = []PrimitiveCoreSpec{
CoreRule: func(p Primitive) (bool, []Value) {
v := []Value{{Kind: "primitive", Primitive: p}}
if valueEquivalentValues(p.Arguments[0], p.Arguments[1], true) {
return true, []Value{p.Arguments[0]}
return true, v
}
return false, v
},
......
......@@ -96,8 +96,10 @@ func verifyAnalysisReconstruct(
) int {
r := false
ar := []Value{}
isCorePrim := false
switch a.Kind {
case "primitive":
isCorePrim = primitiveIsCorePrim(a.Primitive.Name)
r, ar = possibleToReconstructPrimitive(a.Primitive, valAttackerState)
for _, aa := range a.Primitive.Arguments {
verifyAnalysisReconstruct(aa, valPrincipalState, valAttackerState, o)
......@@ -105,7 +107,7 @@ func verifyAnalysisReconstruct(
case "equation":
r, ar = possibleToReconstructEquation(a.Equation, valAttackerState)
}
if r && attackerStatePutWrite(a) {
if r && !isCorePrim && attackerStatePutWrite(a) {
InfoMessage(fmt.Sprintf(
"%s obtained by reconstructing with %s.",
infoOutputText(a), prettyValues(ar),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment