mirror of
https://github.com/irssi/irssi.git
synced 2026-08-23 02:22:36 +02:00
Add pinned TLS fingerprint support.
This patch adds support for pinning TLS fingerprints. Setting a pinned fingerprint will override all other TLS verification and will thus be the only variable that will be looked at when connecting to a TLS enabled IRC server.
This commit is contained in:
parent
fb78787d4e
commit
78f007d493
31 changed files with 1114 additions and 357 deletions
|
|
@ -930,3 +930,23 @@ char **strsplit_len(const char *str, int len, gboolean onspace)
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *binary_to_hex(unsigned char *buffer, size_t size)
|
||||
{
|
||||
static const char hex[] = "0123456789ABCDEF";
|
||||
char *result = NULL;
|
||||
int i;
|
||||
|
||||
if (buffer == NULL || size == 0)
|
||||
return NULL;
|
||||
|
||||
result = g_malloc(2 * size + size);
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
result[i * 3 + 0] = hex[(buffer[i] >> 4) & 0xf];
|
||||
result[i * 3 + 1] = hex[(buffer[i] >> 0) & 0xf];
|
||||
result[i * 3 + 2] = i == size - 1 ? '\0' : ':';
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue