+/*
+ * Display the fingerprints of the PGP Master Keys to the user.
+ */
+void pgp_fingerprints(void)
+{
+ message_box("These are the fingerprints of the PuTTY PGP Master Keys. They can\n"
+ "be used to establish a trust path from this executable to another\n"
+ "one. See the manual for more information.\n"
+ "(Note: these fingerprints have nothing to do with SSH!)\n"
+ "\n"
+ "PuTTY Master Key (RSA), 1024-bit:\n"
+ " " PGP_RSA_MASTER_KEY_FP "\n"
+ "PuTTY Master Key (DSA), 1024-bit:\n"
+ " " PGP_DSA_MASTER_KEY_FP,
+ "PGP fingerprints", MB_ICONINFORMATION | MB_OK,
+ HELPCTXID(pgp_fingerprints));
+}
+
+/*
+ * Handy wrapper around GetDlgItemText which doesn't make you invent
+ * an arbitrary length limit on the output string. Returned string is
+ * dynamically allocated; caller must free.
+ */
+char *GetDlgItemText_alloc(HWND hwnd, int id)
+{
+ char *ret = NULL;
+ int size = 0;
+
+ do {
+ size = size * 4 / 3 + 512;
+ ret = sresize(ret, size, char);
+ GetDlgItemText(hwnd, id, ret, size);
+ } while (!memchr(ret, '\0', size-1));
+
+ return ret;
+}
+