Lines Matching refs:key

8  * validity of the host key.
40 #include "key.h"
55 * Session identifier that is used to bind key exchange and authentication
71 auth_rsa_generate_challenge(Key *key)
83 if (BN_mod(challenge, challenge, key->rsa->n, ctx) == 0)
91 auth_rsa_verify_response(Key *key, BIGNUM *challenge, u_char response[16])
98 if (BN_num_bits(key->rsa->n) < SSH_RSA_MINIMUM_MODULUS_SIZE) {
100 BN_num_bits(key->rsa->n), SSH_RSA_MINIMUM_MODULUS_SIZE);
131 auth_rsa_challenge_dialog(Key *key)
140 challenge = PRIVSEP(auth_rsa_generate_challenge(key));
142 /* Encrypt the challenge with the public key. */
143 rsa_public_encrypt(encrypted_challenge, challenge, key->rsa);
158 success = PRIVSEP(auth_rsa_verify_response(key, challenge, response));
171 Key *key;
173 debug("trying public RSA key file %s", file);
178 * Go though the accepted keys, looking for the current key. If
180 * user really has the corresponding private key.
182 key = key_new(KEY_RSA1);
195 * Check if there are options for this key, and if so,
212 /* Parse the key from the line. */
213 if (hostfile_read_key(&cp, &bits, key) == 0) {
214 debug("%.100s, line %lu: non ssh1 key syntax",
221 * Check if the we have found the desired key (identified
224 if (BN_cmp(key->rsa->n, client_n) != 0)
228 keybits = BN_num_bits(key->rsa->n);
232 file, linenum, BN_num_bits(key->rsa->n), bits);
234 fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX);
235 debug("matching key found: file %s, line %lu %s %s",
236 file, linenum, key_type(key), fp);
239 /* Never accept a revoked key */
240 if (auth_key_is_revoked(key))
243 /* We have found the desired key. */
245 * If our options do not allow this key to be used,
252 /* break out, this key is allowed */
260 /* return key if allowed */
262 *rkey = key;
264 key_free(key);
270 * check if there's user key matching client_n,
271 * return key if login is allowed, NULL otherwise
304 Key *key;
311 if (!PRIVSEP(auth_rsa_key_allowed(pw, client_n, &key))) {
316 /* Perform the challenge-response dialog for this key. */
317 if (!auth_rsa_challenge_dialog(key)) {
325 key_free(key);
334 pubkey_auth_info(authctxt, key, NULL);