Module: ngircd.git Branch: master Commit: 646a97de5fea240f8e06e1b38aa9e72ea50e0c8c URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=646a9...
Author: Federico G. Schwindt fgsch@lodoss.net Date: Sun Aug 4 03:14:27 2013 +0100
Rename XXX_Fingerprint to XXX_CertFp
---
src/ngircd/client.c | 4 ++-- src/ngircd/conn-ssl.c | 8 ++++---- src/ngircd/conn-ssl.h | 4 ++-- src/ngircd/conn.c | 12 ++++++------ src/ngircd/conn.h | 4 ++-- src/ngircd/irc-info.c | 8 ++++---- src/ngircd/irc-metadata.c | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/src/ngircd/client.c b/src/ngircd/client.c index 73dcfca..9358dbb 100644 --- a/src/ngircd/client.c +++ b/src/ngircd/client.c @@ -1596,11 +1596,11 @@ Client_Announce(CLIENT * Client, CLIENT * Prefix, CLIENT * User) return DISCONNECTED; }
- if (Conn_GetFingerprint(Client_Conn(User))) { + if (Conn_GetCertFp(Client_Conn(User))) { if (!IRC_WriteStrClientPrefix(Client, Prefix, "METADATA %s certfp :%s", Client_ID(User), - Conn_GetFingerprint(Client_Conn(User)))) + Conn_GetCertFp(Client_Conn(User)))) return DISCONNECTED; } } diff --git a/src/ngircd/conn-ssl.c b/src/ngircd/conn-ssl.c index 7141eac..0bca933 100644 --- a/src/ngircd/conn-ssl.c +++ b/src/ngircd/conn-ssl.c @@ -633,7 +633,7 @@ ConnSSL_Connect( CONNECTION *c ) }
static int -ConnSSL_InitFingerprint( CONNECTION *c ) +ConnSSL_InitCertFp( CONNECTION *c ) { const char hex[] = "0123456789abcdef"; int i; @@ -723,7 +723,7 @@ ConnectAccept( CONNECTION *c, bool connect) if (ret) return ConnSSL_HandleError(c, ret, "gnutls_handshake"); #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)); ConnSSL_LogCertInfo(c); @@ -817,13 +817,13 @@ ConnSSL_GetCipherInfo(CONNECTION *c, char *buf, size_t len) }
char * -ConnSSL_GetFingerprint(CONNECTION *c) +ConnSSL_GetCertFp(CONNECTION *c) { return c->ssl_state.fingerprint; }
bool -ConnSSL_SetFingerprint(CONNECTION *c, const char *fingerprint) +ConnSSL_SetCertFp(CONNECTION *c, const char *fingerprint) { assert (c != NULL); c->ssl_state.fingerprint = strdup(fingerprint); diff --git a/src/ngircd/conn-ssl.h b/src/ngircd/conn-ssl.h index fc705f1..1e995fd 100644 --- a/src/ngircd/conn-ssl.h +++ b/src/ngircd/conn-ssl.h @@ -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 bool ConnSSL_GetCipherInfo PARAMS(( CONNECTION *c, char *buf, size_t len )); -GLOBAL char *ConnSSL_GetFingerprint PARAMS(( CONNECTION *c )); -GLOBAL bool ConnSSL_SetFingerprint PARAMS(( CONNECTION *c, const char *fingerprint )); +GLOBAL char *ConnSSL_GetCertFp PARAMS(( CONNECTION *c )); +GLOBAL bool ConnSSL_SetCertFp PARAMS(( CONNECTION *c, const char *fingerprint ));
#endif /* SSL_SUPPORT */ #endif /* conn_ssl_h */ diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index 9c6baef..5967fd7 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -2613,22 +2613,22 @@ Conn_UsesSSL(CONN_ID Idx)
GLOBAL char * -Conn_GetFingerprint(CONN_ID Idx) +Conn_GetCertFp(CONN_ID Idx) { if (Idx < 0) return NULL; assert(Idx < (int) array_length(&My_ConnArray, sizeof(CONNECTION))); - return ConnSSL_GetFingerprint(&My_Connections[Idx]); + return ConnSSL_GetCertFp(&My_Connections[Idx]); }
GLOBAL bool -Conn_SetFingerprint(CONN_ID Idx, const char *fingerprint) +Conn_SetCertFp(CONN_ID Idx, const char *fingerprint) { if (Idx < 0) return false; assert(Idx < (int) array_length(&My_ConnArray, sizeof(CONNECTION))); - return ConnSSL_SetFingerprint(&My_Connections[Idx], fingerprint); + return ConnSSL_SetCertFp(&My_Connections[Idx], fingerprint); } #else GLOBAL bool @@ -2639,14 +2639,14 @@ Conn_UsesSSL(UNUSED CONN_ID Idx)
GLOBAL char * -Conn_GetFingerprint(UNUSED CONN_ID Idx) +Conn_GetCertFp(UNUSED CONN_ID Idx) { return NULL; }
GLOBAL bool -Conn_SetFingerprint(UNUSED CONN_ID Idx, UNUSED const char *fingerprint) +Conn_SetCertFp(UNUSED CONN_ID Idx, UNUSED const char *fingerprint) { return true; } diff --git a/src/ngircd/conn.h b/src/ngircd/conn.h index a6cf53a..c642541 100644 --- a/src/ngircd/conn.h +++ b/src/ngircd/conn.h @@ -139,8 +139,8 @@ GLOBAL CONN_ID Conn_GetFromProc PARAMS((int fd)); GLOBAL CLIENT* Conn_GetClient PARAMS((CONN_ID i)); GLOBAL PROC_STAT* Conn_GetProcStat PARAMS((CONN_ID i));
-GLOBAL char *Conn_GetFingerprint PARAMS((CONN_ID Idx)); -GLOBAL bool Conn_SetFingerprint PARAMS((CONN_ID Idx, const char *fingerprint)); +GLOBAL char *Conn_GetCertFp PARAMS((CONN_ID Idx)); +GLOBAL bool Conn_SetCertFp PARAMS((CONN_ID Idx, const char *fingerprint)); GLOBAL bool Conn_UsesSSL PARAMS((CONN_ID Idx));
#ifdef SSL_SUPPORT diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c index 22284cb..3769bef 100644 --- a/src/ngircd/irc-info.c +++ b/src/ngircd/irc-info.c @@ -387,11 +387,11 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c) return DISCONNECTED;
/* Certificate fingerprint? */ - if (Conn_GetFingerprint(Client_Conn(c)) && + if (Conn_GetCertFp(Client_Conn(c)) && from == c && !IRC_WriteStrClient(from, RPL_WHOISCERTFP_MSG, Client_ID(from), Client_ID(c), - Conn_GetFingerprint(Client_Conn(c)))) + Conn_GetCertFp(Client_Conn(c)))) return DISCONNECTED; }
@@ -462,10 +462,10 @@ Show_MOTD_SSLInfo(CLIENT *Client) return false; }
- if (Conn_GetFingerprint(Client_Conn(Client))) { + if (Conn_GetCertFp(Client_Conn(Client))) { snprintf(buf, sizeof(buf), "Your client certificate fingerprint is: %s", - Conn_GetFingerprint(Client_Conn(Client))); + Conn_GetCertFp(Client_Conn(Client))); if (!IRC_WriteStrClient(Client, RPL_MOTD_MSG, Client_ID(Client), buf)) return false; diff --git a/src/ngircd/irc-metadata.c b/src/ngircd/irc-metadata.c index d64ffb2..d185488 100644 --- a/src/ngircd/irc-metadata.c +++ b/src/ngircd/irc-metadata.c @@ -97,7 +97,7 @@ IRC_METADATA(CLIENT *Client, REQUEST *Req) else if (*Req->argv[2] && strcasecmp(Req->argv[1], "user") == 0) Client_SetUser(target, Req->argv[2], true); 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 Log(LOG_WARNING, "Ignored metadata update from "%s" for client "%s": "%s=%s" - unknown key!",
ngircd-commits@lists.barton.de