~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/md5/md5.cc

  • Committer: Brian Aker
  • Date: 2010-03-24 19:45:37 UTC
  • mfrom: (1377.3.20 pandora-build)
  • Revision ID: brian@gaz-20100324194537-hf3tpibznhozvwl1
Merge monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
#include "config.h"
18
18
 
19
 
/* Include these before the openssl headers, because they are BROKEN AS CRAP */
20
19
#include <cstdio>
21
20
#include <cstddef>
22
21
 
23
 
#if defined(HAVE_LIBGNUTLS_OPENSSL)
24
 
# include <gnutls/openssl.h>
25
 
#else
26
 
# include <openssl/md5.h>
27
 
#endif /* HAVE_GNUTLS_OPENSSL */
 
22
#include <gcrypt.h>
28
23
 
29
24
#include <drizzled/plugin/function.h>
30
25
#include <drizzled/item/func.h>
75
70
 
76
71
  unsigned char digest[16];
77
72
  str->set_charset(&my_charset_bin);
78
 
  MD5_CTX context;
79
 
  MD5_Init(&context);
80
 
  MD5_Update(&context, (unsigned char *) sptr->ptr(), sptr->length());
81
 
  MD5_Final(digest, &context);
 
73
 
 
74
  gcry_md_hash_buffer(GCRY_MD_MD5, digest, sptr->ptr(), sptr->length());
82
75
 
83
76
  snprintf((char *) str->ptr(), 33,
84
77
    "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",