- if (!silc_pkcs_load_public_key(filename, &public_key)) {
- silc_say(client, "Received server %s public key", hostname);
- silc_say(client, "Could not load your local copy of the server %s key",
- hostname);
- if (silc_client_ask_yes_no(client,
- "Would you like to accept the server key anyway (y/n)? "))
- {
- /* Save the key for future checking */
- unlink(filename);
- silc_pkcs_save_public_key_data(filename, pk, pk_len);
- return TRUE;
- }
-
- return FALSE;
- }
-
+ if (!silc_pkcs_load_public_key(filename, &public_key,
+ SILC_PKCS_FILE_PEM))
+ if (!silc_pkcs_load_public_key(filename, &public_key,
+ SILC_PKCS_FILE_BIN)) {
+ fingerprint = silc_hash_fingerprint(NULL, pk, pk_len);
+ silc_say(client, "Received server %s public key", hostname);
+ silc_say(client, "Fingerprint for the server %s key is", hostname);
+ silc_say(client, "%s", fingerprint);
+ silc_free(fingerprint);
+ silc_say(client, "Could not load your local copy of the server %s key",
+ hostname);
+ if (silc_client_ask_yes_no(client,
+ "Would you like to accept the key anyway (y/n)? "))
+ {
+ /* Save the key for future checking */
+ unlink(filename);
+ silc_pkcs_save_public_key_data(filename, pk, pk_len,
+ SILC_PKCS_FILE_PEM);
+ return TRUE;
+ }
+
+ return FALSE;
+ }
+