phonchi / libfenc

Automatically exported from code.google.com/p/libfenc
Other
0 stars 0 forks source link

segmentation fault if attributes do not satisfy the policy #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Setup scheme: abe-setup -m CP
2. Generate user key: abe-keygen -m CP -a 'ONE' -o userCP.key
3. Encryption: abe-enc -m CP -i filename.txt -p "((ONE and TWO) or THREE)" -o 
outfile
4. Decryption: abe-dec -m CP -k userCP.key -f outfile.cpabe

What is the expected output? What do you see instead?
The expected output is any message. However, I see a 'segmentation fault'.

What version of the product are you using? On what operating system?
fenc-0.2.0 on Linux

Please provide any additional information below.
Regardless the return value of libfenc_decrypt(), abe_decrypt() in 
tools/mgabe-dec.c was extracting the AES key. In fact, abe_decrypt() should 
extract the AES key only if libfenc_decrypt() does not return any error.

I have developed a patch (please see the attachment) in which a check has been 
added to avoid the segmentation fault.

Regards,
Rizwan

Original issue reported on code.google.com by mrizwan...@gmail.com on 6 Mar 2013 at 1:03

Attachments: