diff options
Diffstat (limited to 'authfile.c')
-rw-r--r-- | authfile.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/authfile.c b/authfile.c index 3bfca4ac5..cd600362a 100644 --- a/authfile.c +++ b/authfile.c | |||
@@ -36,7 +36,7 @@ | |||
36 | */ | 36 | */ |
37 | 37 | ||
38 | #include "includes.h" | 38 | #include "includes.h" |
39 | RCSID("$OpenBSD: authfile.c,v 1.42 2001/12/19 17:16:13 stevesk Exp $"); | 39 | RCSID("$OpenBSD: authfile.c,v 1.43 2001/12/27 18:22:16 markus Exp $"); |
40 | 40 | ||
41 | #include <openssl/err.h> | 41 | #include <openssl/err.h> |
42 | #include <openssl/evp.h> | 42 | #include <openssl/evp.h> |
@@ -316,8 +316,6 @@ key_load_private_rsa1(int fd, const char *filename, const char *passphrase, | |||
316 | char *cp; | 316 | char *cp; |
317 | CipherContext ciphercontext; | 317 | CipherContext ciphercontext; |
318 | Cipher *cipher; | 318 | Cipher *cipher; |
319 | BN_CTX *ctx; | ||
320 | BIGNUM *aux; | ||
321 | Key *prv = NULL; | 319 | Key *prv = NULL; |
322 | 320 | ||
323 | len = lseek(fd, (off_t) 0, SEEK_END); | 321 | len = lseek(fd, (off_t) 0, SEEK_END); |
@@ -406,17 +404,7 @@ key_load_private_rsa1(int fd, const char *filename, const char *passphrase, | |||
406 | buffer_get_bignum(&decrypted, prv->rsa->p); /* q */ | 404 | buffer_get_bignum(&decrypted, prv->rsa->p); /* q */ |
407 | 405 | ||
408 | /* calculate p-1 and q-1 */ | 406 | /* calculate p-1 and q-1 */ |
409 | ctx = BN_CTX_new(); | 407 | rsa_generate_additional_parameters(prv->rsa); |
410 | aux = BN_new(); | ||
411 | |||
412 | BN_sub(aux, prv->rsa->q, BN_value_one()); | ||
413 | BN_mod(prv->rsa->dmq1, prv->rsa->d, aux, ctx); | ||
414 | |||
415 | BN_sub(aux, prv->rsa->p, BN_value_one()); | ||
416 | BN_mod(prv->rsa->dmp1, prv->rsa->d, aux, ctx); | ||
417 | |||
418 | BN_clear_free(aux); | ||
419 | BN_CTX_free(ctx); | ||
420 | 408 | ||
421 | buffer_free(&decrypted); | 409 | buffer_free(&decrypted); |
422 | close(fd); | 410 | close(fd); |