CogniCrypt
CogniCrypt copied to clipboard
error on crypto analysis
Describe the bug
For some reason, cognicrypt is reporting an error on a code that it seems to be ok (it is also available in the CogniCrypt documentation)
To Reproduce Steps to reproduce the behavior:
- Go to the source code of the DemoClass example and copy it to a new Java project
- Click on ' Apply CognicCrypt .... button
- See error: "Operation on object of type javax.crypto.KeyGenerator object not completed. Expected call to init, javax.crypto.KeyGenerator: javax.crypto.SecretKey generateKey()"
Expected behavior
CogniCrypt should not report an error in this case.
Screenshots
Desktop (please complete the following information):
- OS: OSX version 10.14.6
- Eclipse IDE for Java Developers version 4.14
- CogniCrypt version: 1.0.0.201905081022
Thanks for reporting. I was able to reproduce it. The finding is related to the exception.
Technically, if generateKey
throws an Exception, the control flow continues in the catch block and the keyGen
object is not in an accepting state! However, the error message is confusing.
Note, an invocation transitions the state of the object when execution of the instruction is completed (i.e. when data-flow returns from generateKey
).