-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
As an example, suppose we want to verify xor in xor.c:
#include <smack.h>
#include "../ct-verif.h"
void xor(int *key, int *out) {
// key is secret, out is public
*out = key[0];
*out ^= key[1];
}
void xor_wrapper(int *key, int *out) {
public_in(__SMACK_value(key));
public_in(__SMACK_value(out));
public_in(__SMACK_values(out,1));
public_out(__SMACK_values(out,1));
declassified_out(__SMACK_values(out,1));
xor(key, out);
}
The xor function xors the two secret values in key and stores the result in the public out. It does this by erroneously storing the intermediate value in out, thereby leaking key[0]. However, ct-verif verifies this program with the following command in an examples subdirectory: WD=${PWD} ENTRYPOINTS=xor_wrapper EXAMPLE=xor.c make -C ../../bin verify.
Is this a problem? It seems like it would be since key[0] is leaked, but I may be doing something wrong.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels