]> jfr.im git - irc/irssi/irssi.git/commit
Add x509 certificate and public key pinning support.
authorAlexander Færøy <redacted>
Sun, 16 Oct 2016 12:39:00 +0000 (14:39 +0200)
committerAlexander Færøy <redacted>
Sat, 22 Oct 2016 20:01:50 +0000 (22:01 +0200)
commit5146ce96318bc9a2513d104ea76ab3277a540074
tree0a0e049374b482766f0503d221b6176feb7ccc62
parentc6c2e795376e4659810360deaa3dd28475d0f7c7
Add x509 certificate and public key pinning support.

This patch adds two new options to /CONNECT and /SERVER to let the user
pin either an x509 certificate and/or the public key of a given server.

It is possible to fetch the certificate outside of Irssi itself to
verify the checksum. To fetch the certificate call:

    $ openssl s_client -connect chat.freenode.net:6697 < /dev/null 2>/dev/null | \
      openssl x509 > freenode.cert

This will download chat.freenode.net:6697's TLS certificate and put it into the
file freenode.cert.

-tls_pinned_cert
----------------

This option allows you to specify the SHA-256 hash of the x509
certificate. When succesfully connected to the server, irssi will verify
that the given server certificate matches the pin set by the user.

The SHA-256 hash of a given certificate can be verified outside of irssi
using the OpenSSL command line tool:

    $ openssl x509 -in freenode.cert -fingerprint -sha256 -noout

-tls_pinned_pubkey
------------------

This option allows you to specify the SHA-256 hash of the subject public key
information section of the server certificate. This section contains both the
cryptographic parameters for the public key, but also information about the
algorithm used together with the public key parameters.

When succesfully connected to the server, irssi will verify that the
given public key matches the pin set by the user.

The SHA-256 hash of a public key can be verified outside of irssi using
the OpenSSL command line tool:

    $ openssl x509 -in freenode.cert -pubkey -noout | \
      openssl pkey -pubin -outform der | \
      openssl dgst -sha256 -c | \
      tr a-z A-Z

It is possible to specify both -tls_pinned_cert and -tls_pinned_pubkey
together.
13 files changed:
NEWS
docs/help/in/connect.in
docs/help/in/server.in
src/core/chat-commands.c
src/core/network-openssl.c
src/core/server-connect-rec.h
src/core/server-setup-rec.h
src/core/servers-reconnect.c
src/core/servers-setup.c
src/core/servers.c
src/core/session.c
src/fe-common/core/fe-server.c
src/fe-common/irc/fe-irc-server.c