summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/authfile.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2003-03-13 11:42:18 +0000
committermarkus <markus@openbsd.org>2003-03-13 11:42:18 +0000
commit4f51379f9ee01168da4e1a847222e90ba505761e (patch)
tree1e01fad80e51275d9a87f5b8464eec53c7446db7 /usr.bin/ssh/authfile.c
parentanother (diff)
downloadwireguard-openbsd-4f51379f9ee01168da4e1a847222e90ba505761e.tar.xz
wireguard-openbsd-4f51379f9ee01168da4e1a847222e90ba505761e.zip
move RSA_blinding_on to generic key load method
Diffstat (limited to 'usr.bin/ssh/authfile.c')
-rw-r--r--usr.bin/ssh/authfile.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/ssh/authfile.c b/usr.bin/ssh/authfile.c
index 33217bf3b68..932cc2cf48e 100644
--- a/usr.bin/ssh/authfile.c
+++ b/usr.bin/ssh/authfile.c
@@ -36,7 +36,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: authfile.c,v 1.51 2002/11/15 10:03:09 fgsch Exp $");
+RCSID("$OpenBSD: authfile.c,v 1.52 2003/03/13 11:42:18 markus Exp $");
#include <openssl/err.h>
#include <openssl/evp.h>
@@ -421,6 +421,12 @@ key_load_private_rsa1(int fd, const char *filename, const char *passphrase,
rsa_generate_additional_parameters(prv->rsa);
buffer_free(&decrypted);
+
+ /* enable blinding */
+ if (RSA_blinding_on(prv->rsa, NULL) != 1) {
+ error("key_load_private_rsa1: RSA_blinding_on failed");
+ goto fail;
+ }
close(fd);
return prv;
@@ -460,6 +466,11 @@ key_load_private_pem(int fd, int type, const char *passphrase,
#ifdef DEBUG_PK
RSA_print_fp(stderr, prv->rsa, 8);
#endif
+ if (RSA_blinding_on(prv->rsa, NULL) != 1) {
+ error("key_load_private_pem: RSA_blinding_on failed");
+ key_free(prv);
+ prv = NULL;
+ }
} else if (pk->type == EVP_PKEY_DSA &&
(type == KEY_UNSPEC||type==KEY_DSA)) {
prv = key_new(KEY_UNSPEC);