Lines Matching defs:challenge
76 BIGNUM *challenge;
79 if ((challenge = BN_new()) == NULL)
81 /* Generate a random challenge. */
82 if (BN_rand(challenge, 256, 0, 0) == 0)
86 if (BN_mod(challenge, challenge, key->rsa->n, ctx) == 0)
90 return challenge;
94 auth_rsa_verify_response(Key *key, BIGNUM *challenge, u_char response[16])
108 /* The response is MD5 of decrypted challenge plus session id. */
109 len = BN_num_bytes(challenge);
111 fatal("%s: bad challenge length %d", __func__, len);
113 BN_bn2bin(challenge, buf + 32 - len);
121 /* Verify that the response is the original challenge. */
131 * Performs the RSA authentication challenge-response dialog with the client,
133 * our challenge; returns zero if the client gives a wrong answer.
139 BIGNUM *challenge, *encrypted_challenge;
146 challenge = PRIVSEP(auth_rsa_generate_challenge(key));
148 /* Encrypt the challenge with the public key. */
149 if (rsa_public_encrypt(encrypted_challenge, challenge, key->rsa) != 0)
152 /* Send the encrypted challenge to the client. */
165 success = PRIVSEP(auth_rsa_verify_response(key, challenge, response));
166 BN_clear_free(challenge);
186 * found, perform a challenge-response dialog to verify that the
255 * do not send challenge.
325 /* Perform the challenge-response dialog for this key. */
328 verbose("Wrong response to RSA authentication challenge.");
329 packet_send_debug("Wrong response to RSA authentication challenge.");
332 * another challenge and break the protocol.