]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/chap-md5.c
config: Include some extra files in the tarball
[ppp.git] / pppd / chap-md5.c
index d9259d2515517b6eaec6a6637f7c2e8469578ed6..7b66ae2598c181dc6ede4f3244e9247360176993 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * chap-md5.c - New CHAP/MD5 implementation.
  *
- * Copyright (c) 2003 Paul Mackerras. All rights reserved.
+ * Copyright (c) 2003-2024 Paul Mackerras. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
  *
- * 2. The name(s) of the authors of this software must not be used to
- *    endorse or promote products derived from this software without
- *    prior written permission.
- *
- * 3. Redistributions of any form whatsoever must retain the following
- *    acknowledgment:
- *    "This product includes software developed by Paul Mackerras
- *     <paulus@ozlabs.org>".
+ * 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.
  *
  * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
@@ -28,8 +24,6 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#define RCSID  "$Id: chap-md5.c,v 1.4 2004/11/09 22:39:25 paulus Exp $"
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -112,6 +106,7 @@ chap_md5_make_response(unsigned char *response, int id, char *our_name,
        int challenge_len = *challenge++;
        int hash_len = MD5_DIGEST_LENGTH;
 
+       response[0] = 0;
        PPP_MD_CTX* ctx = PPP_MD_CTX_new();
        if (ctx) {
 
@@ -133,6 +128,8 @@ chap_md5_make_response(unsigned char *response, int id, char *our_name,
                }
                PPP_MD_CTX_free(ctx);
        }
+       if (response[0] == 0)
+               warn("Error occurred in preparing CHAP-Response");
 }
 
 static struct chap_digest_type md5_digest = {