-
Notifications
You must be signed in to change notification settings - Fork 599
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
Minor modifications to PKCS5KeyFile #265
Conversation
… was used, which prevented decryption with a subsequent correct passphrase. Also, made it possible for subclasses of PKCS5KeyFile to access the decrypted ASN.1 data directly (useful if you want to decrypt then store a PKCS5 key for later use elsewhere). And I think I made the code a little prettier.
I would like to see an added testcase ;) Prevents stuff from breaking again when refactoring |
Also codacy shows that you've introduced 2 new code issues with this PR |
I'm not sure what to make of the two codacy issues:
I will add a test case. |
I've just added codacy, so there might still be some things in the ruleset that can be tweaked ;) I agree with keeping the static factory classes on top. As for the NPath complexity, it complains that it is still too high. Reduction can normally be achieved by extracting into different methods for different paths :) |
} | ||
} else if (line.startsWith("DEK-Info: ")) { | ||
int ptr = line.indexOf(","); | ||
if (ptr == -1) { | ||
throw new IOException("Unrecognized DEK-Info: " + line.substring(10)); | ||
throw new FormatException("Unrecognized DEK-Info: " + line.substring(10)); | ||
} else { | ||
String algorithm = line.substring(10,ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That one seems like a false positive, i.e. this is a local variable not a field.
I transplanted the test... I need to put the test into my build workflow so this doesn't happen again. Do you really want me to make the new test class less readable per Codacy? |
Actually the question would be, why are they static final fields if they're 2016-08-19 22:11 GMT+02:00 JovalCM notifications@github.com:
|
I just copied from the OpenSSHKeyFileTest. The id_dsa file (used by that test) is an encrypted PKCS5 key file, and its test checks the exact use-case that was broken. Constants are static final fields in all the keyfile tests. |
Just wanted to get this out of the way before tackling the logger factory issue.