+ if (state->keytype == ECDSA && !(state->keysize == 256 ||
+ state->keysize == 384 ||
+ state->keysize == 521)) {
+ int ret = MessageBox(hwnd,
+ "Only 256, 384 and 521 bit elliptic"
+ " curves are supported.\n"
+ "Key length reset to 256. Continue?",
+ "PuTTYgen Warning",
+ MB_ICONWARNING | MB_OKCANCEL);
+ if (ret != IDOK)
+ break;
+ state->keysize = 256;
+ SetDlgItemInt(hwnd, IDC_BITS, 256, FALSE);
+ }
+ if (state->keytype == ED25519 && state->keysize != 256) {
+ int ret = MessageBox(hwnd,
+ "Only 256 bit Edwards elliptic"
+ " curves are supported.\n"
+ "Key length reset to 256. Continue?",
+ "PuTTYgen Warning",
+ MB_ICONWARNING | MB_OKCANCEL);
+ if (ret != IDOK)
+ break;
+ state->keysize = 256;
+ SetDlgItemInt(hwnd, IDC_BITS, 256, FALSE);
+ }