X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Fsilcd%2Fserver.c;h=1f468f1dac29103a9450488c7af211a98e8f44c5;hb=c077f32b9139acbbd3f33d1a3c6293b5788337e6;hp=b9a09d99d4e4dcb830caee5c2e335dd6e5a1aebf;hpb=f56f45aa509dde80443f6bf642f7fed0891c082e;p=silc.git diff --git a/apps/silcd/server.c b/apps/silcd/server.c index b9a09d99..1f468f1d 100644 --- a/apps/silcd/server.c +++ b/apps/silcd/server.c @@ -765,20 +765,18 @@ SILC_TASK_CALLBACK(silc_server_connect_to_router_second) conn = sconn->conn; if (conn) { - /* Match found. Use the configured authentication method */ + /* Match found. Use the configured authentication method. Take only + the passphrase, since for public key auth we automatically use + our local key pair. */ if (conn->passphrase) { - if (conn->publickey && !server->config->prefer_passphrase_auth) { - proto_ctx->auth_data = conn->publickey; - proto_ctx->auth_data_len = 0; + if (conn->publickeys && !server->config->prefer_passphrase_auth) { proto_ctx->auth_meth = SILC_AUTH_PUBLIC_KEY; } else { proto_ctx->auth_data = strdup(conn->passphrase); proto_ctx->auth_data_len = strlen(conn->passphrase); proto_ctx->auth_meth = SILC_AUTH_PASSWORD; } - } else if (conn->publickey) { - proto_ctx->auth_data = conn->publickey; - proto_ctx->auth_data_len = 0; + } else if (conn->publickeys) { proto_ctx->auth_meth = SILC_AUTH_PUBLIC_KEY; } else { proto_ctx->auth_meth = SILC_AUTH_NONE;