mirror of
https://github.com/osmarks/ngircd.git
synced 2025-02-24 05:00:01 +00:00
Rename XXX_Fingerprint to XXX_CertFp
This commit is contained in:
parent
8e60fac73b
commit
646a97de5f
@ -1596,11 +1596,11 @@ Client_Announce(CLIENT * Client, CLIENT * Prefix, CLIENT * User)
|
|||||||
return DISCONNECTED;
|
return DISCONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Conn_GetFingerprint(Client_Conn(User))) {
|
if (Conn_GetCertFp(Client_Conn(User))) {
|
||||||
if (!IRC_WriteStrClientPrefix(Client, Prefix,
|
if (!IRC_WriteStrClientPrefix(Client, Prefix,
|
||||||
"METADATA %s certfp :%s",
|
"METADATA %s certfp :%s",
|
||||||
Client_ID(User),
|
Client_ID(User),
|
||||||
Conn_GetFingerprint(Client_Conn(User))))
|
Conn_GetCertFp(Client_Conn(User))))
|
||||||
return DISCONNECTED;
|
return DISCONNECTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -633,7 +633,7 @@ ConnSSL_Connect( CONNECTION *c )
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ConnSSL_InitFingerprint( CONNECTION *c )
|
ConnSSL_InitCertFp( CONNECTION *c )
|
||||||
{
|
{
|
||||||
const char hex[] = "0123456789abcdef";
|
const char hex[] = "0123456789abcdef";
|
||||||
int i;
|
int i;
|
||||||
@ -723,7 +723,7 @@ ConnectAccept( CONNECTION *c, bool connect)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ConnSSL_HandleError(c, ret, "gnutls_handshake");
|
return ConnSSL_HandleError(c, ret, "gnutls_handshake");
|
||||||
#endif /* _GNUTLS */
|
#endif /* _GNUTLS */
|
||||||
(void)ConnSSL_InitFingerprint(c);
|
(void)ConnSSL_InitCertFp(c);
|
||||||
|
|
||||||
Conn_OPTION_DEL(c, (CONN_SSL_WANT_WRITE|CONN_SSL_WANT_READ|CONN_SSL_CONNECT));
|
Conn_OPTION_DEL(c, (CONN_SSL_WANT_WRITE|CONN_SSL_WANT_READ|CONN_SSL_CONNECT));
|
||||||
ConnSSL_LogCertInfo(c);
|
ConnSSL_LogCertInfo(c);
|
||||||
@ -817,13 +817,13 @@ ConnSSL_GetCipherInfo(CONNECTION *c, char *buf, size_t len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
ConnSSL_GetFingerprint(CONNECTION *c)
|
ConnSSL_GetCertFp(CONNECTION *c)
|
||||||
{
|
{
|
||||||
return c->ssl_state.fingerprint;
|
return c->ssl_state.fingerprint;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ConnSSL_SetFingerprint(CONNECTION *c, const char *fingerprint)
|
ConnSSL_SetCertFp(CONNECTION *c, const char *fingerprint)
|
||||||
{
|
{
|
||||||
assert (c != NULL);
|
assert (c != NULL);
|
||||||
c->ssl_state.fingerprint = strdup(fingerprint);
|
c->ssl_state.fingerprint = strdup(fingerprint);
|
||||||
|
@ -26,8 +26,8 @@ GLOBAL ssize_t ConnSSL_Write PARAMS(( CONNECTION *c, const void *buf, size_t cou
|
|||||||
GLOBAL ssize_t ConnSSL_Read PARAMS(( CONNECTION *c, void *buf, size_t count));
|
GLOBAL ssize_t ConnSSL_Read PARAMS(( CONNECTION *c, void *buf, size_t count));
|
||||||
|
|
||||||
GLOBAL bool ConnSSL_GetCipherInfo PARAMS(( CONNECTION *c, char *buf, size_t len ));
|
GLOBAL bool ConnSSL_GetCipherInfo PARAMS(( CONNECTION *c, char *buf, size_t len ));
|
||||||
GLOBAL char *ConnSSL_GetFingerprint PARAMS(( CONNECTION *c ));
|
GLOBAL char *ConnSSL_GetCertFp PARAMS(( CONNECTION *c ));
|
||||||
GLOBAL bool ConnSSL_SetFingerprint PARAMS(( CONNECTION *c, const char *fingerprint ));
|
GLOBAL bool ConnSSL_SetCertFp PARAMS(( CONNECTION *c, const char *fingerprint ));
|
||||||
|
|
||||||
#endif /* SSL_SUPPORT */
|
#endif /* SSL_SUPPORT */
|
||||||
#endif /* conn_ssl_h */
|
#endif /* conn_ssl_h */
|
||||||
|
@ -2613,22 +2613,22 @@ Conn_UsesSSL(CONN_ID Idx)
|
|||||||
|
|
||||||
|
|
||||||
GLOBAL char *
|
GLOBAL char *
|
||||||
Conn_GetFingerprint(CONN_ID Idx)
|
Conn_GetCertFp(CONN_ID Idx)
|
||||||
{
|
{
|
||||||
if (Idx < 0)
|
if (Idx < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
assert(Idx < (int) array_length(&My_ConnArray, sizeof(CONNECTION)));
|
assert(Idx < (int) array_length(&My_ConnArray, sizeof(CONNECTION)));
|
||||||
return ConnSSL_GetFingerprint(&My_Connections[Idx]);
|
return ConnSSL_GetCertFp(&My_Connections[Idx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GLOBAL bool
|
GLOBAL bool
|
||||||
Conn_SetFingerprint(CONN_ID Idx, const char *fingerprint)
|
Conn_SetCertFp(CONN_ID Idx, const char *fingerprint)
|
||||||
{
|
{
|
||||||
if (Idx < 0)
|
if (Idx < 0)
|
||||||
return false;
|
return false;
|
||||||
assert(Idx < (int) array_length(&My_ConnArray, sizeof(CONNECTION)));
|
assert(Idx < (int) array_length(&My_ConnArray, sizeof(CONNECTION)));
|
||||||
return ConnSSL_SetFingerprint(&My_Connections[Idx], fingerprint);
|
return ConnSSL_SetCertFp(&My_Connections[Idx], fingerprint);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
GLOBAL bool
|
GLOBAL bool
|
||||||
@ -2639,14 +2639,14 @@ Conn_UsesSSL(UNUSED CONN_ID Idx)
|
|||||||
|
|
||||||
|
|
||||||
GLOBAL char *
|
GLOBAL char *
|
||||||
Conn_GetFingerprint(UNUSED CONN_ID Idx)
|
Conn_GetCertFp(UNUSED CONN_ID Idx)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GLOBAL bool
|
GLOBAL bool
|
||||||
Conn_SetFingerprint(UNUSED CONN_ID Idx, UNUSED const char *fingerprint)
|
Conn_SetCertFp(UNUSED CONN_ID Idx, UNUSED const char *fingerprint)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -139,8 +139,8 @@ GLOBAL CONN_ID Conn_GetFromProc PARAMS((int fd));
|
|||||||
GLOBAL CLIENT* Conn_GetClient PARAMS((CONN_ID i));
|
GLOBAL CLIENT* Conn_GetClient PARAMS((CONN_ID i));
|
||||||
GLOBAL PROC_STAT* Conn_GetProcStat PARAMS((CONN_ID i));
|
GLOBAL PROC_STAT* Conn_GetProcStat PARAMS((CONN_ID i));
|
||||||
|
|
||||||
GLOBAL char *Conn_GetFingerprint PARAMS((CONN_ID Idx));
|
GLOBAL char *Conn_GetCertFp PARAMS((CONN_ID Idx));
|
||||||
GLOBAL bool Conn_SetFingerprint PARAMS((CONN_ID Idx, const char *fingerprint));
|
GLOBAL bool Conn_SetCertFp PARAMS((CONN_ID Idx, const char *fingerprint));
|
||||||
GLOBAL bool Conn_UsesSSL PARAMS((CONN_ID Idx));
|
GLOBAL bool Conn_UsesSSL PARAMS((CONN_ID Idx));
|
||||||
|
|
||||||
#ifdef SSL_SUPPORT
|
#ifdef SSL_SUPPORT
|
||||||
|
@ -387,11 +387,11 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c)
|
|||||||
return DISCONNECTED;
|
return DISCONNECTED;
|
||||||
|
|
||||||
/* Certificate fingerprint? */
|
/* Certificate fingerprint? */
|
||||||
if (Conn_GetFingerprint(Client_Conn(c)) &&
|
if (Conn_GetCertFp(Client_Conn(c)) &&
|
||||||
from == c &&
|
from == c &&
|
||||||
!IRC_WriteStrClient(from, RPL_WHOISCERTFP_MSG,
|
!IRC_WriteStrClient(from, RPL_WHOISCERTFP_MSG,
|
||||||
Client_ID(from), Client_ID(c),
|
Client_ID(from), Client_ID(c),
|
||||||
Conn_GetFingerprint(Client_Conn(c))))
|
Conn_GetCertFp(Client_Conn(c))))
|
||||||
return DISCONNECTED;
|
return DISCONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,10 +462,10 @@ Show_MOTD_SSLInfo(CLIENT *Client)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Conn_GetFingerprint(Client_Conn(Client))) {
|
if (Conn_GetCertFp(Client_Conn(Client))) {
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
"Your client certificate fingerprint is: %s",
|
"Your client certificate fingerprint is: %s",
|
||||||
Conn_GetFingerprint(Client_Conn(Client)));
|
Conn_GetCertFp(Client_Conn(Client)));
|
||||||
if (!IRC_WriteStrClient(Client, RPL_MOTD_MSG,
|
if (!IRC_WriteStrClient(Client, RPL_MOTD_MSG,
|
||||||
Client_ID(Client), buf))
|
Client_ID(Client), buf))
|
||||||
return false;
|
return false;
|
||||||
|
@ -97,7 +97,7 @@ IRC_METADATA(CLIENT *Client, REQUEST *Req)
|
|||||||
else if (*Req->argv[2] && strcasecmp(Req->argv[1], "user") == 0)
|
else if (*Req->argv[2] && strcasecmp(Req->argv[1], "user") == 0)
|
||||||
Client_SetUser(target, Req->argv[2], true);
|
Client_SetUser(target, Req->argv[2], true);
|
||||||
else if (*Req->argv[2] && strcasecmp(Req->argv[1], "certfp") == 0)
|
else if (*Req->argv[2] && strcasecmp(Req->argv[1], "certfp") == 0)
|
||||||
Conn_SetFingerprint(Client_Conn(target), Req->argv[2]);
|
Conn_SetCertFp(Client_Conn(target), Req->argv[2]);
|
||||||
else
|
else
|
||||||
Log(LOG_WARNING,
|
Log(LOG_WARNING,
|
||||||
"Ignored metadata update from \"%s\" for client \"%s\": \"%s=%s\" - unknown key!",
|
"Ignored metadata update from \"%s\" for client \"%s\": \"%s=%s\" - unknown key!",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user