| @@ -1,32 +1,34 @@ | | | @@ -1,32 +1,34 @@ |
1 | $NetBSD: patch-uuid.c,v 1.1.1.1 2011/03/05 17:54:35 brook Exp $ | | 1 | $NetBSD: patch-uuid.c,v 1.2 2011/03/08 03:20:16 brook Exp $ |
| | | 2 | |
| | | 3 | Use the openssl SHA1 API instead of the FreeBSD API. |
2 | | | 4 | |
3 | --- uuid.c.orig 2010-03-14 03:04:29.000000000 -0600 | | 5 | --- uuid.c.orig 2010-03-14 03:04:29.000000000 -0600 |
4 | +++ uuid.c 2011-02-12 10:51:10.000000000 -0700 | | 6 | +++ uuid.c 2011-02-12 10:51:10.000000000 -0700 |
5 | @@ -40,7 +40,7 @@ | | 7 | @@ -40,7 +40,7 @@ |
6 | #undef uuid_hash | | 8 | #undef uuid_hash |
7 | | | 9 | |
8 | #include <md5.h> | | 10 | #include <md5.h> |
9 | -#include <sha.h> | | 11 | -#include <sha.h> |
10 | +#include <sha1.h> | | 12 | +#include <sha1.h> |
11 | | | 13 | |
12 | PG_MODULE_MAGIC; | | 14 | PG_MODULE_MAGIC; |
13 | | | 15 | |
14 | @@ -158,13 +158,13 @@ | | 16 | @@ -158,13 +158,13 @@ |
15 | | | 17 | |
16 | case 5: /* namespace-based SHA1 uuids */ | | 18 | case 5: /* namespace-based SHA1 uuids */ |
17 | { | | 19 | { |
18 | - SHA_CTX ctx; | | 20 | - SHA_CTX ctx; |
19 | + SHA1_CTX ctx; | | 21 | + SHA1_CTX ctx; |
20 | unsigned char buf[20]; | | 22 | unsigned char buf[20]; |
21 | | | 23 | |
22 | - SHA1_Init(&ctx); | | 24 | - SHA1_Init(&ctx); |
23 | - SHA1_Update(&ctx, ns, 16); | | 25 | - SHA1_Update(&ctx, ns, 16); |
24 | - SHA1_Update(&ctx, (unsigned char *)ptr, len); | | 26 | - SHA1_Update(&ctx, (unsigned char *)ptr, len); |
25 | - SHA1_Final(buf, &ctx); | | 27 | - SHA1_Final(buf, &ctx); |
26 | + SHA1Init(&ctx); | | 28 | + SHA1Init(&ctx); |
27 | + SHA1Update(&ctx, ns, 16); | | 29 | + SHA1Update(&ctx, ns, 16); |
28 | + SHA1Update(&ctx, (unsigned char *)ptr, len); | | 30 | + SHA1Update(&ctx, (unsigned char *)ptr, len); |
29 | + SHA1Final(buf, &ctx); | | 31 | + SHA1Final(buf, &ctx); |
30 | | | 32 | |
31 | sprintf(strbuf, | | 33 | sprintf(strbuf, |
32 | "%02x%02x%02x%02x-" | | 34 | "%02x%02x%02x%02x-" |