/*
- * "$Id: md5passwd.c 4828 2005-11-11 12:53:38Z mike $"
+ * MD5 password support for CUPS.
*
- * MD5 password support for the Common UNIX Printing System (CUPS).
+ * Copyright 2007-2010 by Apple Inc.
+ * Copyright 1997-2005 by Easy Software Products.
*
- * Copyright 1997-2005 by Easy Software Products.
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * missing or damaged, see the license at "http://www.cups.org/".
*
- * These coded instructions, statements, and computer programs are the
- * property of Easy Software Products and are protected by Federal
- * copyright law. Distribution and use rights are outlined in the file
- * "LICENSE.txt" which should have been included with this file. If this
- * file is missing or damaged please contact Easy Software Products
- * at:
- *
- * Attn: CUPS Licensing Information
- * Easy Software Products
- * 44141 Airport View Drive, Suite 204
- * Hollywood, Maryland 20636 USA
- *
- * Voice: (301) 373-9600
- * EMail: cups-info@cups.org
- * WWW: http://www.cups.org
- *
- * This file is subject to the Apple OS-Developed Software exception.
- *
- * Contents:
- *
- * httpMD5() - Compute the MD5 sum of the username:group:password.
- * httpMD5Nonce() - Combine the MD5 sum of the username, group, and password
- * with the server-supplied nonce value.
- * httpMD5String() - Convert an MD5 sum to a character string.
+ * This file is subject to the Apple OS-Developed Software exception.
*/
/*
* Include necessary headers...
*/
-#include "http.h"
-#include "string.h"
+#include "http-private.h"
+#include "string-private.h"
/*
*/
snprintf(line, sizeof(line), "%s:%s:%s", username, realm, passwd);
- _cups_md5_init(&state);
- _cups_md5_append(&state, (unsigned char *)line, (int)strlen(line));
- _cups_md5_finish(&state, sum);
+ _cupsMD5Init(&state);
+ _cupsMD5Append(&state, (unsigned char *)line, (int)strlen(line));
+ _cupsMD5Finish(&state, sum);
/*
* Return the sum...
*/
snprintf(line, sizeof(line), "%s:%s", method, resource);
- _cups_md5_init(&state);
- _cups_md5_append(&state, (unsigned char *)line, (int)strlen(line));
- _cups_md5_finish(&state, sum);
+ _cupsMD5Init(&state);
+ _cupsMD5Append(&state, (unsigned char *)line, (int)strlen(line));
+ _cupsMD5Finish(&state, sum);
httpMD5String(sum, a2);
/*
snprintf(line, sizeof(line), "%s:%s:%s", md5, nonce, a2);
- _cups_md5_init(&state);
- _cups_md5_append(&state, (unsigned char *)line, (int)strlen(line));
- _cups_md5_finish(&state, sum);
+ _cupsMD5Init(&state);
+ _cupsMD5Append(&state, (unsigned char *)line, (int)strlen(line));
+ _cupsMD5Finish(&state, sum);
return (httpMD5String(sum, md5));
}
return (md5);
}
-
-
-/*
- * End of "$Id: md5passwd.c 4828 2005-11-11 12:53:38Z mike $".
- */