+ * Update the visible key list.
+ */
+static void keylist_update(void) {
+ struct RSAKey *rkey;
+ struct ssh2_userkey *skey;
+ enum234 e;
+
+ if (keylist) {
+ SendDlgItemMessage(keylist, 100, LB_RESETCONTENT, 0, 0);
+ for (rkey = first234(rsakeys, &e); rkey; rkey = next234(&e)) {
+ char listentry[512], *p;
+ /*
+ * Replace two spaces in the fingerprint with tabs, for
+ * nice alignment in the box.
+ */
+ strcpy(listentry, "ssh1\t");
+ p = listentry+strlen(listentry);
+ rsa_fingerprint(p, sizeof(listentry)-(p-listentry), rkey);
+ p = strchr(listentry, ' '); if (p) *p = '\t';
+ p = strchr(listentry, ' '); if (p) *p = '\t';
+ SendDlgItemMessage (keylist, 100, LB_ADDSTRING,
+ 0, (LPARAM)listentry);
+ }
+ for (skey = first234(ssh2keys, &e); skey; skey = next234(&e)) {
+ char listentry[512], *p;
+ int len;
+ /*
+ * Replace two spaces in the fingerprint with tabs, for
+ * nice alignment in the box.
+ */
+ p = skey->alg->fingerprint(skey->data);
+ strncpy(listentry, p, sizeof(listentry));
+ p = strchr(listentry, ' '); if (p) *p = '\t';
+ p = strchr(listentry, ' '); if (p) *p = '\t';
+ len = strlen(listentry);
+ if (len < sizeof(listentry)-2) {
+ listentry[len] = '\t';
+ strncpy(listentry+len+1, skey->comment, sizeof(listentry)-len-1);
+ }
+ SendDlgItemMessage (keylist, 100, LB_ADDSTRING,
+ 0, (LPARAM)listentry);
+ }
+ SendDlgItemMessage (keylist, 100, LB_SETCURSEL, (WPARAM) -1, 0);
+ }
+}
+
+/*