2013-09-26 18:25:54 +02:00
|
|
|
From: http://bugs.irssi.org/index.php?do=details&task_id=305
|
|
|
|
-> http://bugs.irssi.org/index.php?getfile=298
|
|
|
|
Redraw logic removed.
|
2014-07-15 01:49:29 +02:00
|
|
|
Index: src/core/network-openssl.c
|
2013-09-26 18:25:54 +02:00
|
|
|
===================================================================
|
2014-07-15 01:49:29 +02:00
|
|
|
--- src/core/network-openssl.c.orig
|
|
|
|
+++ src/core/network-openssl.c
|
|
|
|
@@ -418,6 +418,16 @@ static GIOFuncs irssi_ssl_channel_funcs
|
2013-09-26 18:25:54 +02:00
|
|
|
irssi_ssl_get_flags
|
|
|
|
};
|
|
|
|
|
|
|
|
+static int getpass_cb(char *buf, int size, int rwflag, void *keyname)
|
|
|
|
+{
|
|
|
|
+ char *pp, prompt[256];
|
|
|
|
+ snprintf(prompt, 256, "Enter PEM pass phrase:"); // for %s:", keyname);
|
|
|
|
+ pp = getpass(prompt);
|
|
|
|
+ strncpy(buf, pp, size);
|
|
|
|
+ buf[size - 1] = '\0';
|
|
|
|
+ return(strlen(buf));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static gboolean irssi_ssl_init(void)
|
|
|
|
{
|
|
|
|
SSL_library_init();
|
2014-07-15 01:49:29 +02:00
|
|
|
@@ -484,6 +494,8 @@ static GIOChannel *irssi_ssl_get_iochann
|
2013-09-26 18:25:54 +02:00
|
|
|
scert = convert_home(mycert);
|
|
|
|
if (mypkey && *mypkey)
|
|
|
|
spkey = convert_home(mypkey);
|
|
|
|
+ SSL_CTX_set_default_passwd_cb(ctx, getpass_cb);
|
|
|
|
+ SSL_CTX_set_default_passwd_cb_userdata(ctx, spkey);
|
|
|
|
if (! SSL_CTX_use_certificate_file(ctx, scert, SSL_FILETYPE_PEM))
|
2014-07-15 01:49:29 +02:00
|
|
|
g_warning("Loading of client certificate '%s' failed: %s", mycert, ERR_reason_error_string(ERR_get_error()));
|
2013-09-26 18:25:54 +02:00
|
|
|
else if (! SSL_CTX_use_PrivateKey_file(ctx, spkey ? spkey : scert, SSL_FILETYPE_PEM))
|