Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error on crypto analysis #363

Open
rbonifacio opened this issue Jan 29, 2020 · 1 comment
Open

error on crypto analysis #363

rbonifacio opened this issue Jan 29, 2020 · 1 comment

Comments

@rbonifacio
Copy link

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:

  1. Go to the source code of the DemoClass example and copy it to a new Java project
  2. Click on ' Apply CognicCrypt .... button
  3. 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

cc-error

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
@johspaeth
Copy link
Contributor

johspaeth commented Jan 29, 2020

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants