tomaswolf commented on issue #830:
URL: https://github.com/apache/mina-sshd/issues/830#issuecomment-3380876758

   1. The problem is not BC-FIPS specific, it also occurs with normal BC.
   2. From the KeyStore, your code gets a key generated by SunEC, not by Bouncy 
Castle. SunEC encodes the key's algorithm ID as OID 1.2.840.10045.2.1 ("EC 
public key") with parameters OID 1.3.132.0.35 ("secp521r1"). When that key is 
read back from the network buffer by Bouncy Castle, it is reconstructed 
correctly , but is then a BCECPublicKey. This BCECPublicKey is encoded by 
writing the algorithm ID as OID 1.2.840.10045.2.1 ("EC public key") followed 
not by the curve OID but by the curve parameters. This explains the different 
X.509 encodings.
   3. Using `allowedKey.equals(incomingKey);` may return `false` if comparing a 
SunEC key against a BC key. Maybe use `KeyUtils.compare()` instead. (Not sure 
it'll help.)
   6. If you intend to use BC-FIPS, you probably also want the KeyStore to use 
BC-FIPS.
   7. Didn't have the time to investigate further.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to