Skip to content

Conversation

@fmeum
Copy link
Contributor

@fmeum fmeum commented May 27, 2020

While PKCS8KeyFile uses PasswordFinder's shouldRetry to determine
whether it should call reqPassword again if decryption of they key file
fails, OpenSSHKeyV1KeyFile simply gives up and throws an exception.

With this commit, retry logic similar to that of PKCS8KeyFile is added
to OpenSSHKeyV1KeyFile. The PasswordFinder's reqPassword is called
again if the validation of the "checkint" fails, which indicates an
incorrect passphrase.

While PKCS8KeyFile uses PasswordFinder's shouldRetry to determine
whether it should call reqPassword again if decryption of they key file
fails, OpenSSHKeyV1KeyFile simply gives up and throws an exception.

With this commit, retry logic similar to that of PKCS8KeyFile is added
to OpenSSHKeyV1KeyFile. The PasswordFinder's reqPassword is called
again if the validation of the "checkint" fails, which indicates an
incorrect passphrase.
@fmeum fmeum requested a review from hierynomus as a code owner May 27, 2020 11:40
@fmeum
Copy link
Contributor Author

fmeum commented May 27, 2020

I think that the CI fails here and in #586 are due to 3526694. I confirmed that this builds and retries correctly locally, but some unit tests fail due to seemingly unrelated Mockito exceptions.

@hierynomus
Copy link
Owner

I think that the CI fails here and in #586 are due to 3526694. I confirmed that this builds and retries correctly locally, but some unit tests fail due to seemingly unrelated Mockito exceptions.

The CI failures are indeed due to that change. Have to dive into it why this happens.

@fmeum
Copy link
Contributor Author

fmeum commented May 27, 2020

The second commit replaces EncryptionException with a new exception type defined as an inner class.

@hierynomus
Copy link
Owner

I've merged master into this PR, in order to fix the builds.

@hierynomus hierynomus merged commit dfdc464 into hierynomus:master May 28, 2020
@fmeum fmeum deleted the fhenneke_retry branch May 28, 2020 07:28
@hierynomus
Copy link
Owner

Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants