]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2002/07/03 09:55:38
authormouring <mouring>
Thu, 4 Jul 2002 00:17:33 +0000 (00:17 +0000)
committermouring <mouring>
Thu, 4 Jul 2002 00:17:33 +0000 (00:17 +0000)
     [ssh-keysign.c]
     use RSA_blinding_on() for rsa hostkeys (suggested by Bill Sommerfeld)
     in order to avoid a possible Kocher timing attack pointed out by Charles
     Hannum; ok provos@

ChangeLog
ssh-keysign.c

index 4c26d6641030f66b67228089de25f8e8936ccbed..2f9b6731cd6ca484984b2b28941746295e56a39e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      [sshconnect2.c]
      for compression=yes, we fallback to no-compression if the server does
      not support compression, vice versa for compression=no. ok mouring@
+   - markus@cvs.openbsd.org 2002/07/03 09:55:38
+     [ssh-keysign.c]
+     use RSA_blinding_on() for rsa hostkeys (suggested by Bill Sommerfeld)
+     in order to avoid a possible Kocher timing attack pointed out by Charles
+     Hannum; ok provos@
 
 20020702
  - (djm) Use PAM_MSG_MEMBER for PAM_TEXT_INFO messages, use xmalloc & 
index 6a435684bcc08d150418a68a9ce967347b127846..bed2b987488192d3cda86bcb5dbe73ef6d20bca0 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: ssh-keysign.c,v 1.5 2002/06/26 22:27:32 markus Exp $");
+RCSID("$OpenBSD: ssh-keysign.c,v 1.6 2002/07/03 09:55:38 markus Exp $");
 
 #include <openssl/evp.h>
+#include <openssl/rand.h>
+#include <openssl/rsa.h>
 
 #include "log.h"
 #include "key.h"
@@ -140,6 +142,7 @@ main(int argc, char **argv)
        u_char *signature, *data;
        char *host;
        u_int slen, dlen;
+       u_int32_t rnd[256];
 
        key_fd[0] = open(_PATH_HOST_RSA_KEY_FILE, O_RDONLY);
        key_fd[1] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY);
@@ -163,6 +166,9 @@ main(int argc, char **argv)
        pw = pwcopy(pw);
 
        SSLeay_add_all_algorithms();
+       for (i = 0; i < 256; i++)
+               rnd[i] = arc4random();
+       RAND_seed(rnd, sizeof(rnd));
 
        found = 0;
        for (i = 0; i < 2; i++) {
@@ -172,6 +178,13 @@ main(int argc, char **argv)
                keys[i] = key_load_private_pem(key_fd[i], KEY_UNSPEC,
                    NULL, NULL);
                close(key_fd[i]);
+               if (keys[i] != NULL && keys[i]->type == KEY_RSA) {
+                       if (RSA_blinding_on(keys[i]->rsa, NULL) != 1) {
+                               error("RSA_blinding_on failed");
+                               key_free(keys[i]);
+                               keys[i] = NULL;
+                       }
+               }
                if (keys[i] != NULL)
                        found = 1;
        }
This page took 0.055275 seconds and 5 git commands to generate.