Couldn't you just do this...?

// Restrict to alphanumeric passwords
char c;
for (unsigned int x=0; x < sizeof(password)/sizeof(char); ++x)
{
   c = password[x];
   klee_assume( (c >= '0' & c <= '9') | (c >= 'A' & c <= 'Z') | (c >=
'a' & c <= 'z') );
}


You could probably do something a bit nicer by using the functions in ctype.h

Thanks,
Dan Liew.

On 16 September 2013 08:43, Loi Luu <[email protected]> wrote:
> I make a string variable as symbolic as:
>
> unsigned char password[12];
> klee_make_symbolic(password, sizeof(password),"password");
>
> Is there any way like klee_assume to restrict all characters of password to
> be only normal characters and numbers?
>
> Thank you,
>

_______________________________________________
klee-dev mailing list
[email protected]
https://mailman.ic.ac.uk/mailman/listinfo/klee-dev

Reply via email to