5
5
* | (__| |_| | _ <| |___
6
6
* \___|\___/|_| \_\_____|
8
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
8
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
10
10
* This software is licensed as described in the file COPYING, which
11
11
* you should have received as part of this distribution. The terms
18
18
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
* KIND, either express or implied.
21
* $Id: md5.c,v 1.12 2007-11-07 09:21:35 bagder Exp $
21
* $Id: md5.c,v 1.15 2009-02-12 20:48:44 danf Exp $
22
22
***************************************************************************/
26
26
#ifndef CURL_DISABLE_CRYPTO_AUTH
28
#if !defined(USE_SSLEAY) || !defined(USE_OPENSSL)
29
/* This code segment is only used if OpenSSL is not provided, as if it is
30
we use the MD5-function provided there instead. No good duplicating
36
void Curl_md5it(unsigned char *outbuffer, /* 16 bytes */
37
const unsigned char *input)
40
gcry_md_open(&ctx, GCRY_MD_MD5, 0);
41
gcry_md_write(ctx, input, (unsigned int)strlen((char *)input));
42
memcpy (outbuffer, gcry_md_read (ctx, 0), 16);
49
/* When OpenSSL is available we use the MD5-function from OpenSSL */
52
# include <openssl/md5.h>
57
#else /* USE_SSLEAY */
58
/* When OpenSSL is not available we use this code segment */
33
60
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
332
357
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
336
/* If OpenSSL is present */
337
#include <openssl/md5.h>
360
#endif /* USE_SSLEAY */
343
362
void Curl_md5it(unsigned char *outbuffer, /* 16 bytes */
344
363
const unsigned char *input)