summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sshkey.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* move check_host_cert() from sshconnect,c to sshkey.c and refactordjm2021-01-261-2/+4
| | | | | | it to make it more generally usable and testable. ok markus@
* Replace WITH_OPENSSL ifdefs in log calls with a macro. The log callsdtucker2020-11-081-1/+3
| | | | | | are themselves now macros, and preprocessor directives inside macro arguments are undefined behaviour which some compilers (eg old GCCs) choke on. It also makes the code tidier. ok deraadt@
* Adapt XMSS to new logging infrastructure. With markus@, ok djm@.dtucker2020-10-191-5/+4
|
* support for user-verified FIDO keysdjm2020-08-271-5/+6
| | | | | | | | | | | | | | | FIDO2 supports a notion of "user verification" where the user is required to demonstrate their identity to the token before particular operations (e.g. signing). Typically this is done by authenticating themselves using a PIN that has been set on the token. This adds support for generating and using user verified keys where the verification happens via PIN (other options might be added in the future, but none are in common use now). Practically, this adds another key generation option "verify-required" that yields a key that requires a PIN before each authentication. feedback markus@ and Pedro Martelletto; ok markus@
* add sshkey_parse_pubkey_from_private_fileblob_type()djm2020-04-081-1/+3
| | | | | | | Extracts a public key from the unencrypted envelope of a new-style OpenSSH private key. ok markus@
* SK API and sk-helper error/PIN passingdjm2019-12-301-9/+1
| | | | | | | | | | | Allow passing a PIN via the SK API (API major crank) and let the ssh-sk-helper API follow. Also enhance the ssh-sk-helper API to support passing back an error code instead of a complete reply. Will be used to signal "wrong PIN", etc. feedback and ok markus@
* implement loading of resident keys in ssh-sk-helperdjm2019-12-301-1/+2
| | | | feedback and ok markus@
* perform security key enrollment via ssh-sk-helper too. This meansdjm2019-12-131-2/+6
| | | | | | | that ssh-keygen no longer needs to link against ssh-sk-helper, and only ssh-sk-helper needs libfido2 and /dev/uhid* access; feedback & ok markus@
* use ssh-sk-helper for all security key signing operationsdjm2019-12-131-1/+4
| | | | | | | | | This extracts and refactors the client interface for ssh-sk-helper from ssh-agent and generalises it for use by the other programs. This means that most OpenSSH tools no longer need to link against libfido2 or directly interact with /dev/uhid* requested by, feedback and ok markus@
* Add new structure for signature optionsdjm2019-11-251-4/+14
| | | | | | | | | This is populated during signature verification with additional fields that are present in and covered by the signature. At the moment, it is only used to record security key-specific options, especially the flags field. with and ok markus@
* fix shield/unshield for xmss keys:markus2019-11-131-4/+5
| | | | | | | | - in ssh-agent we need to delay the call to shield until we have received key specific options. - when serializing xmss keys for shield we need to deal with all optional components (e.g. state might not be loaded). ok djm@
* enable ed25519 support; ok djmmarkus2019-11-121-3/+4
|
* implement ssh-ed25519-sk verification; ok djm@markus2019-11-121-1/+6
|
* Refactor signing - use sshkey_sign for everything, including the newdjm2019-10-311-5/+6
| | | | | | | | | | | U2F signatures. Don't use sshsk_ecdsa_sign() directly, instead make it reachable via sshkey_sign() like all other signature operations. This means that we need to add a provider argument to sshkey_sign(), so most of this change is mechanically adding that. Suggested by / ok markus@
* Initial infrastructure for U2F/FIDO supportdjm2019-10-311-1/+18
| | | | | | | Key library support: including allocation, marshalling public/private keys and certificates, signature validation. feedback & ok markus@
* make get_sigtype public as sshkey_get_sigtype(); ok markus@djm2019-09-031-1/+2
|
* support PKCS8 as an optional format for storage of private keys,djm2019-07-151-2/+9
| | | | | | | | | | | | enabled via "ssh-keygen -m PKCS8" on operations that save private keys to disk. The OpenSSH native key format remains the default, but PKCS8 is a superior format to PEM if interoperability with non-OpenSSH software is required, as it may use a less terrible KDF (IIRC PEM uses a single round of MD5 as a KDF). adapted from patch by Jakub Jelen via bz3013; ok markus
* Add protection for private keys at rest in RAM against speculationdjm2019-06-211-6/+15
| | | | | | | | | | | | | | | | | | | | | | | and memory sidechannel attacks like Spectre, Meltdown, Rowhammer and Rambleed. This change encrypts private keys when they are not in use with a symmetic key that is derived from a relatively large "prekey" consisting of random data (currently 16KB). Attackers must recover the entire prekey with high accuracy before they can attempt to decrypt the shielded private key, but the current generation of attacks have bit error rates that, when applied cumulatively to the entire prekey, make this unlikely. Implementation-wise, keys are encrypted "shielded" when loaded and then automatically and transparently unshielded when used for signatures or when being saved/serialised. Hopefully we can remove this in a few years time when computer architecture has become less unsafe. been in snaps for a bit already; thanks deraadt@ ok dtucker@ deraadt@
* add support for ECDSA keys in PKCS#11 tokensdjm2019-01-201-1/+2
| | | | Work by markus@ and Pedro Martelletto, feedback and ok me@
* garbage-collect moribund ssh_new_private() API.djm2018-09-141-2/+1
|
* hold our collective noses and use the openssl-1.1.x API in OpenSSH;djm2018-09-131-5/+4
| | | | feedback and ok tb@ jsing@ markus@
* add sshkey_check_cert_sigtype() that checks a cert->signature_typedjm2018-09-121-1/+2
| | | | against a supplied whitelist; ok markus
* add cert->signature_type field and keep it in sync with certificatedjm2018-09-121-1/+2
| | | | signature wrt loading and certification operations; ok markus@
* some finesse to fix RSA-SHA2 certificate authentication for certsdjm2018-07-031-1/+2
| | | | hosted in ssh-agent
* Improve strictness and control over RSA-SHA2 signature types:djm2018-07-031-2/+2
| | | | | | | | | | | | | | | | | | | | | In ssh, when an agent fails to return a RSA-SHA2 signature when requested and falls back to RSA-SHA1 instead, retry the signature to ensure that the public key algorithm sent in the SSH_MSG_USERAUTH matches the one in the signature itself. In sshd, strictly enforce that the public key algorithm sent in the SSH_MSG_USERAUTH message matches what appears in the signature. Make the sshd_config PubkeyAcceptedKeyTypes and HostbasedAcceptedKeyTypes options control accepted signature algorithms (previously they selected supported key types). This allows these options to ban RSA-SHA1 in favour of RSA-SHA2. Add new signature algorithms "rsa-sha2-256-cert-v01@openssh.com" and "rsa-sha2-512-cert-v01@openssh.com" to force use of RSA-SHA2 signatures with certificate keys. feedback and ok markus@
* Add experimental support for PQC XMSS keys (Extended Hash-Based Signatures)markus2018-02-231-1/+34
| | | | | | | The code is not compiled in by default (see WITH_XMSS in Makefile.inc) Joint work with stefan-lukas_gazdag at genua.eu See https://tools.ietf.org/html/draft-irtf-cfrg-xmss-hash-based-signatures-12 ok djm@
* pass negotiated signing algorithm though to sshkey_verify() anddjm2017-12-181-3/+4
| | | | | check that the negotiated algorithm matches the type in the signature (only matters for RSA SHA1/SHA2 sigs). ok markus@
* sshkey_sigtype() function to return the type of a signature;djm2017-12-181-1/+2
| | | | ok markus@
* remove post-SSHv1 removal dead code from rsa.c and merge thedjm2017-07-011-1/+4
| | | | remaining bit that it still used into ssh-rsa.c; ok markus
* Allow ssh-keygen to use a key held in ssh-agent as a CA when signingdjm2017-06-281-2/+8
| | | | certificates. bz#2377 ok markus
* missing prototype.djm2017-06-131-1/+2
|
* Refuse RSA keys <1024 bits in length. Improve reporting for keys thatdjm2017-05-071-2/+2
| | | | do not meet this requirement. ok markus@
* remove miscellaneous SSH1 leftovers; ok markus@naddy2017-05-031-3/+1
|
* remove KEY_RSA1djm2017-04-301-2/+1
| | | | ok markus@
* fix regression in 7.4 server-sig-algs, where we were accidentallydjm2017-03-101-2/+2
| | | | | excluding SHA2 RSA signature methods. bz#2680, patch from Nuno Goncalves; ok dtucker@
* list all supported signature algorithms in the server-sig-algsdjm2016-09-121-2/+2
| | | | | Reported by mb AT smartftp.com in bz#2547 and (independantly) Ron Frederick; ok markus@
* support SHA256 and SHA512 RSA signatures in certificates;djm2016-05-021-2/+2
| | | | ok markus@
* implement SHA2-{256,512} for RSASSA-PKCS1-v1_5 signatures (user and host auth)markus2015-12-041-6/+6
| | | | | based on draft-rsa-dsa-sha2-256-03.txt and draft-ssh-ext-info-04.txt; with & ok djm@
* move the certificate validity formatting code to sshkey.[ch]djm2015-11-191-1/+3
|
* - Fix error message: passphrase needs to be at least 5 characters, not 4.tim2015-09-131-3/+2
| | | | | | | - Remove unused function argument. - Remove two unnecessary variables. OK djm@
* backout SSH_RSA_MINIMUM_MODULUS_SIZE increase for this release;djm2015-08-041-2/+2
| | | | problems spotted by sthen@ ok deraadt@ markus@
* another SSH_RSA_MINIMUM_MODULUS_SIZE that needed crankingdjm2015-07-031-2/+2
|
* delete support for legacy v00 certificates; "sure" markus@ dtucker@djm2015-07-031-5/+2
|
* refactor: split base64 encoding of pubkey into its owndjm2015-05-211-1/+2
| | | | | sshkey_to_base64() function and out of sshkey_write(); ok markus@
* small refactor and add some convenience functions;djm2015-01-261-3/+6
| | | | ok markus
* add sshd_config HostbasedAcceptedKeyTypes and PubkeyAcceptedKeyTypesdjm2015-01-131-2/+2
| | | | | options to allow sshd to control what public key types will be accepted. Currently defaults to all. Feedback & ok markus@
* deprecate key_load_private_pem() and sshkey_load_private_pem()djm2015-01-081-3/+1
| | | | | | | | | | | | | | | interfaces. Refactor the generic key loading API to not require pathnames to be specified (they weren't really used). Fixes a few other things en passant: Makes ed25519 keys work for hostbased authentication (ssh-keysign previously used the PEM-only routines). Fixes key comment regression bz#2306: key pathnames were being lost as comment fields. ok markus@
* Add FingerprintHash option to control algorithm used for keydjm2014-12-211-9/+7
| | | | | | | fingerprints. Default changes from MD5 to SHA256 and format from hex to base64. Feedback and ok naddy@ markus@
* New key API: refactor key-related functions to be more library-like,djm2014-06-241-0/+222
existing API is offered as a set of wrappers. with and ok markus@ Thanks also to Ben Hawkes, David Tomaschik, Ivan Fratric, Matthew Dempsky and Ron Bowes for a detailed review a few months ago.