X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/65a22376e5875181e41108028091018cdcd4fdae..03169ad0902dcea0737ad7c92a9248e9fe6022e7:/puttygen.c?ds=sidebyside diff --git a/puttygen.c b/puttygen.c index e93781c4..19245f80 100644 --- a/puttygen.c +++ b/puttygen.c @@ -325,7 +325,7 @@ static void setupbigedit1(HWND hwnd, int id, struct RSAKey *key) { static void setupbigedit2(HWND hwnd, int id, struct ssh2_userkey *key) { unsigned char *pub_blob; char *buffer, *p; - int pub_len, buflen; + int pub_len; int i; pub_blob = key->alg->public_blob(key->data, &pub_len); @@ -530,8 +530,13 @@ static int CALLBACK MainDlgProc (HWND hwnd, UINT msg, sfree(*state->commentptr); *state->commentptr = smalloc(len+1); GetWindowText(editctl, *state->commentptr, len+1); - } - } + if (state->ssh2) { + setupbigedit2(hwnd, IDC_KEYDISPLAY, &state->ssh2key); + } else { + setupbigedit1(hwnd, IDC_KEYDISPLAY, &state->key); + } + } + } break; case IDC_ABOUT: EnableWindow(hwnd, 0); @@ -789,10 +794,13 @@ static int CALLBACK MainDlgProc (HWND hwnd, UINT msg, EnableWindow(GetDlgItem(hwnd, IDC_GENERATE), 1); EnableWindow(GetDlgItem(hwnd, IDC_LOAD), 1); EnableWindow(GetDlgItem(hwnd, IDC_SAVE), 1); - if (state->ssh2) + if (state->ssh2) { + state->ssh2key.data = &state->key; + state->ssh2key.alg = &ssh_rsa; state->commentptr = &state->ssh2key.comment; - else + } else { state->commentptr = &state->key.comment; + } /* * Invent a comment for the key. We'll do this by including * the date in it. This will be so horrifyingly ugly that