while ((conn = silc_dlist_get(server->conns))) {
if (!conn->sock)
continue;
- silc_socket_stream_get_info(conn->sock, NULL, NULL, &ipaddr, NULL);
+ silc_socket_stream_get_info(silc_packet_stream_get_stream(conn->sock),
+ NULL, NULL, &ipaddr, NULL);
idata = silc_packet_get_context(conn->sock);
if (!strcmp(ipaddr, ip) && idata && idata->conn_type == type)
count++;
if (!conn->sock)
continue;
idata = silc_packet_get_context(conn->sock);
- silc_socket_stream_get_info(conn->sock, NULL, NULL, &ipaddr, NULL);
+ silc_socket_stream_get_info(silc_packet_stream_get_stream(conn->sock),
+ NULL, NULL, &ipaddr, NULL);
if (!strcmp(ipaddr, ip) &&
(!port || conn->remote_port == port) &&
idata->conn_type == type)
return public_key;
}
+/* Find public key by client for identification purposes. Finds keys
+ with SILC_SKR_USAGE_IDENTIFICATION. */
+
+SilcBool silc_server_get_public_key_by_client(SilcServer server,
+ SilcClientEntry client,
+ SilcPublicKey *public_key)
+{
+ SilcPublicKey pubkey = NULL;
+ SilcBool ret = FALSE;
+
+ pubkey = silc_server_get_public_key(server, SILC_SKR_USAGE_IDENTIFICATION,
+ client);
+ if (pubkey)
+ ret = TRUE;
+
+ if (public_key)
+ *public_key = pubkey;
+
+ return ret;
+}
+
/* Check whether the connection `sock' is allowed to connect to us. This
checks for example whether there is too much connections for this host,
and required version for the host etc. */
char *r_vendor_version = NULL, *l_vendor_version;
const char *hostname, *ip;
- silc_socket_stream_get_info(sock, NULL, &hostname, &ip, NULL);
+ silc_socket_stream_get_info(silc_packet_stream_get_stream(sock),
+ NULL, &hostname, &ip, NULL);
SILC_LOG_DEBUG(("Checking whether connection is allowed"));