]> andersk Git - openssh.git/commitdiff
- (djm) Use standard OpenSSL functions in auth-skey.c. Patch from
authordjm <djm>
Sun, 2 Jul 2000 09:13:56 +0000 (09:13 +0000)
committerdjm <djm>
Sun, 2 Jul 2000 09:13:56 +0000 (09:13 +0000)
   Chris, the Young One <cky@pobox.com>

ChangeLog
auth-skey.c
scp.c

index 118416f6b5839525a766c4f69ccd663b1e2b3728..a17e435e040c19767cd4f1223ba091164696993b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
  - (djm) Fix brace mismatch from Corinna Vinschen <vinschen@cygnus.com>
  - (djm) Stop shadow expiry checking from preventing logins with NIS. Based
    on fix from HARUYAMA Seigo <haruyama@nt.phys.s.u-tokyo.ac.jp>
+ - (djm) Use standard OpenSSL functions in auth-skey.c. Patch from
+   Chris, the Young One <cky@pobox.com>
 
 20000701
  - (djm) Fix Tru64 SIA problems reported by John P Speno <speno@isc.upenn.edu>
index d66d84e7d6a99463dc15d77666490a7c705fda9c..208d380bb88a98c3576398c46d56571c61f3ca7f 100644 (file)
@@ -4,7 +4,7 @@ RCSID("$OpenBSD: auth-skey.c,v 1.7 2000/06/20 01:39:38 markus Exp $");
 
 #include "ssh.h"
 #include "packet.h"
-#include <sha1.h>
+#include <openssl/sha.h>
 
 /* from %OpenBSD: skeylogin.c,v 1.32 1999/08/16 14:46:56 millert Exp % */
 
@@ -74,7 +74,6 @@ skey_fake_keyinfo(char *username)
        size_t secretlen = 0;
        SHA_CTX ctx;
        char *p, *u;
-       char md[SHA_DIGEST_LENGTH];
 
        /*
         * Base first 4 chars of seed on hostname.
@@ -99,7 +98,7 @@ skey_fake_keyinfo(char *username)
 
                SHA1_Init(&ctx);
                SHA1_Update(&ctx, username, strlen(username));
-               SHA1_End(&ctx, up);
+               SHA1_Final(up, &ctx);
 
                /* Collapse the hash */
                ptr = hash_collapse(up);
@@ -133,7 +132,7 @@ skey_fake_keyinfo(char *username)
                SHA1_Init(&ctx);
                SHA1_Update(&ctx, secret, secretlen);
                SHA1_Update(&ctx, username, strlen(username));
-               SHA1_End(&ctx, up);
+               SHA1_Final(up, &ctx);
                
                /* Zero out */
                memset(secret, 0, secretlen);
@@ -141,7 +140,7 @@ skey_fake_keyinfo(char *username)
                /* Now hash the hash */
                SHA1_Init(&ctx);
                SHA1_Update(&ctx, up, strlen(up));
-               SHA1_End(&ctx, up);
+               SHA1_Final(up, &ctx);
                
                ptr = hash_collapse(up + 4);
                
diff --git a/scp.c b/scp.c
index 0a89985de1d5dbb893a7352e54395976f52f3e98..5f849cc1324bb703fbb2279fdda6b742f87be4fe 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -56,6 +56,14 @@ RCSID("$OpenBSD: scp.c,v 1.32 2000/06/20 01:39:44 markus Exp $");
 /* For progressmeter() -- number of seconds before xfer considered "stalled" */
 #define STALLTIME      5
 
+/* Progress meter bar */
+#define BAR \
+       "************************************************************"\
+       "************************************************************"\
+       "************************************************************"\
+       "************************************************************"
+#define MAX_BARLENGTH (sizeof(BAR) - 1)
+
 /* Visual statistics about files as they are transferred. */
 void progressmeter(int);
 
@@ -1172,13 +1180,11 @@ progressmeter(int flag)
        snprintf(buf, sizeof(buf), "\r%-20.20s %3d%% ", curfile, ratio);
 
        barlength = getttywidth() - 51;
+       barlength = (barlength <= MAX_BARLENGTH)?barlength:MAX_BARLENGTH;
        if (barlength > 0) {
                i = barlength * ratio / 100;
                snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
-                        "|%.*s%*s|", i,
-                        "*****************************************************************************"
-                        "*****************************************************************************",
-                        barlength - i, "");
+                        "|%.*s%*s|", i, BAR, barlength - i, "");
        }
        i = 0;
        abbrevsize = cursize;
This page took 0.051265 seconds and 5 git commands to generate.