aboutsummaryrefslogtreecommitdiffstats
path: root/epan/secrets.c
AgeCommit message (Collapse)AuthorFilesLines
2020-01-15Fix UAT PKCS #11 Library handle leakTomasz Moń1-0/+3
CID: 1457255 Change-Id: Iaa6d48be0654d919012def9706e7c4ac562251b0 Reviewed-on: https://code.wireshark.org/review/35642 Petri-Dish: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-01epan: Work around a p11-kit bug on Windows.Gerald Combs1-0/+10
The version of p11-kit that we ship with Windows will crash if we feed gnutls_pkcs11_add_provider an invalid path. Work around this by checking for the file's existence ourselves. Bug: 15957 Change-Id: I81484b8bd8f837a49bc17a6c9cb0b10fd33c3f6e Reviewed-on: https://code.wireshark.org/review/34144 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-01-29secrets: add functions to query and validate pkcs11 tokens/key filesPeter Wu1-5/+143
Provide a way to retrieve key URIs ("pkcs11:" and in the future maybe "system:") and validate the PIN/password for such keys. Additionally permit validation of a RSA key file. This will be used for the RSA Keys GUI dialog. Change-Id: I4177a11cb9f4758d7564daae509e20a4a42623fa Reviewed-on: https://code.wireshark.org/review/31794 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-29Add support for RSA decryption using PKCS #11 tokensPeter Wu1-0/+221
Add support for loading RSA private key files from PKCS #11 tokens, identified by PKCS #11 URIs. Add a new 'pkcs11_libs' UAT which can dynamically load PKCS #11 provider libraries that are not found by p11-kit. The configuration GUI will need additional code to discover available PKCS #11 tokens and will be added later. This feature requires GnuTLS 3.4 with PKCS #11 support, so Windows, macOS via Homebrew, Ubuntu 16.04, Debian Stretch. Not supported: RHEL7. Currently macOS via official packages disables PKCS #11 support, so that will also not work. Change-Id: I20646bfd69c6bd13c8c2d27cb65c164a4b0b7a66 Reviewed-on: https://code.wireshark.org/review/30855 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-14secrets: clarify debug message, fix endianess swapPeter Wu1-1/+2
Change-Id: If02448925f906ae60ab1ad793d7a5069bf8ed10d Reviewed-on: https://code.wireshark.org/review/31044 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-13secrets: fix build with GnuTLS 3.4.0 and olderPeter Wu1-0/+3
Change-Id: Ie6bd309134ebbd27e90b2bf92a2df1abfdfe45a5 Fixes: v2.9.1rc0-3-g4803390686 ("Add new "rsa_keys" UAT for storage of RSA private keys") Reviewed-on: https://code.wireshark.org/review/31031 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-13Add new "rsa_keys" UAT for storage of RSA private keysPeter Wu1-2/+198
This should eventually replace the "ssl_keys" UAT which additionally contains a useless address, port and protocol field. This prepares for HSM support through PKCS #11. Change-Id: I59409c98aeedf260d19266d18e14ef7d9b40b582 Reviewed-on: https://code.wireshark.org/review/30977 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-01TLS: really delay key lookup until it is necessaryPeter Wu1-0/+36
Even if the certificate has a RSA public key, be sure to lookup the key only if it is an actual RSA key exchange. Move the hashtable to the secrets module to enable reuse. Change-Id: I39010831079d3b65d5d4368ec97d02491c1615a5 Reviewed-on: https://code.wireshark.org/review/30854 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-20Add new Secrets API and allow TLS to use pcapng decryption secretsPeter Wu1-0/+58
Add a new secrets API to the core, one that can outlive the lifetime of a single capture file. Expose decryption secrets from wiretap through a callback and let the secrets API route it to a dissector. Bug: 15252 Change-Id: Ie2f1867bdfd265bad11fc58f1e8d8e7295c0d1e7 Reviewed-on: https://code.wireshark.org/review/30705 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>