aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/render/glyph.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-11-17 15:53:57 +0000
committermarha <marha@users.sourceforge.net>2009-11-17 15:53:57 +0000
commit3fce787ffe938bb3e959ff0b3ec231e54d086c76 (patch)
tree198f537b43a34301bf781c67193c572f6743f925 /xorg-server/render/glyph.c
parent236c69d6034b152598ce35abaf3559b0eaa89c12 (diff)
parent578938f1cdd5a06dd6fa28167d575ec980322a5d (diff)
downloadvcxsrv-3fce787ffe938bb3e959ff0b3ec231e54d086c76.tar.gz
vcxsrv-3fce787ffe938bb3e959ff0b3ec231e54d086c76.tar.bz2
vcxsrv-3fce787ffe938bb3e959ff0b3ec231e54d086c76.zip
svn merge ^/branches/released
Diffstat (limited to 'xorg-server/render/glyph.c')
-rw-r--r--xorg-server/render/glyph.c36
1 files changed, 9 insertions, 27 deletions
diff --git a/xorg-server/render/glyph.c b/xorg-server/render/glyph.c
index 7fcdfd9d1..0b864ad4d 100644
--- a/xorg-server/render/glyph.c
+++ b/xorg-server/render/glyph.c
@@ -26,12 +26,7 @@
#include <dix-config.h>
#endif
-#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */
-# include <sha1.h>
-#else /* Use OpenSSL's libcrypto */
-# include <stddef.h> /* buggy openssl/sha.h wants size_t */
-# include <openssl/sha.h>
-#endif
+#include "xsha1.h"
#include "misc.h"
#include "scrnintstr.h"
@@ -198,34 +193,21 @@ HashGlyph (xGlyphInfo *gi,
unsigned long size,
unsigned char sha1[20])
{
-#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */
- SHA1_CTX ctx;
-
- SHA1Init (&ctx);
- SHA1Update (&ctx, gi, sizeof (xGlyphInfo));
- SHA1Update (&ctx, bits, size);
- SHA1Final (sha1, &ctx);
-#else /* Use OpenSSL's libcrypto */
- SHA_CTX ctx;
+ void *ctx = x_sha1_init();
int success;
- success = SHA1_Init (&ctx);
- if (! success)
+ if (!ctx)
return BadAlloc;
- success = SHA1_Update (&ctx, gi, sizeof (xGlyphInfo));
- if (! success)
+ success = x_sha1_update(ctx, gi, sizeof(xGlyphInfo));
+ if (!success)
return BadAlloc;
-
- success = SHA1_Update (&ctx, bits, size);
- if (! success)
+ success = x_sha1_update(ctx, bits, size);
+ if (!success)
return BadAlloc;
-
- success = SHA1_Final (sha1, &ctx);
- if (! success)
+ success = x_sha1_final(ctx, sha1);
+ if (!success)
return BadAlloc;
-#endif
-
return Success;
}