]> andersk Git - openssh.git/blobdiff - auth-skey.c
Add support for GNU rx library for those lacking regexp support
[openssh.git] / auth-skey.c
index d66d84e7d6a99463dc15d77666490a7c705fda9c..1e3cec8602944daf6d4b8bde3b8aa730005c9261 100644 (file)
@@ -1,10 +1,34 @@
+/*
+ * Copyright (c) 1999,2000 Markus Friedl.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "includes.h"
-#ifdef SKEY
-RCSID("$OpenBSD: auth-skey.c,v 1.7 2000/06/20 01:39:38 markus Exp $");
+RCSID("$OpenBSD: auth-skey.c,v 1.8 2000/09/07 20:27:49 deraadt Exp $");
 
+#ifdef SKEY
 #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 +98,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 +122,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 +156,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 +164,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);
                
This page took 0.036885 seconds and 4 git commands to generate.