summaryrefslogtreecommitdiff
path: root/databases/postgresql-uuid/patches/patch-uuid.c
blob: 51e0de62b6cc2e4f3e7dd958f683cd14b3ba6175 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$NetBSD: patch-uuid.c,v 1.2 2011/03/08 03:20:16 brook Exp $

Use the openssl SHA1 API instead of the FreeBSD API.

--- uuid.c.orig	2010-03-14 03:04:29.000000000 -0600
+++ uuid.c	2011-02-12 10:51:10.000000000 -0700
@@ -40,7 +40,7 @@
 #undef uuid_hash
 
 #include <md5.h>
-#include <sha.h>
+#include <sha1.h>
 
 PG_MODULE_MAGIC;
 
@@ -158,13 +158,13 @@
 
 	case 5:  /* namespace-based SHA1 uuids */
 	{
-	    SHA_CTX ctx;
+	    SHA1_CTX ctx;
 	    unsigned char buf[20];
 
-	    SHA1_Init(&ctx);
-	    SHA1_Update(&ctx, ns, 16);
-	    SHA1_Update(&ctx, (unsigned char *)ptr, len);
-	    SHA1_Final(buf, &ctx);
+	    SHA1Init(&ctx);
+	    SHA1Update(&ctx, ns, 16);
+	    SHA1Update(&ctx, (unsigned char *)ptr, len);
+	    SHA1Final(buf, &ctx);
 
 	    sprintf(strbuf,
 		    "%02x%02x%02x%02x-"