Skip to content

Commit

Permalink
Fix RSA encryption bit size to 2048
Browse files Browse the repository at this point in the history
  • Loading branch information
axmanalad authored and HannesWell committed Oct 26, 2024
1 parent d7578a0 commit c2dc063
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,11 @@ else if(e.widget==keyGenerateRSA){
final JSchException[] _e=new JSchException[1];
BusyIndicator.showWhile(getShell().getDisplay(), () -> {
try {
_kpair[0] = KeyPair.genKeyPair(getJSch(), __type);
if (__type == KeyPair.RSA) {
_kpair[0] = KeyPair.genKeyPair(getJSch(), __type, 2048);
} else {
_kpair[0] = KeyPair.genKeyPair(getJSch(), __type);
}
} catch (JSchException e1) {
_e[0] = e1;
}
Expand All @@ -508,7 +512,11 @@ else if(e.widget==keyGenerateRSA){
kpair=_kpair[0];

ByteArrayOutputStream out=new ByteArrayOutputStream();
kpairComment=_type+"-1024"; //$NON-NLS-1$
if (__type == KeyPair.RSA) {
kpairComment = _type + "-2048"; //$NON-NLS-1$
} else {
kpairComment = _type + "-1024"; //$NON-NLS-1$
}
kpair.writePublicKey(out, kpairComment);
out.close();
publicKeyText.setText(out.toString());
Expand Down

0 comments on commit c2dc063

Please sign in to comment.