summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-08-01 21:36:49 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-08-01 21:36:49 +0200
commitb1f85bfb005c4f6c93cf88779e3a12abbd99c973 (patch)
tree404dc0a9a298e7ef6a3f3e68f1b937b0dead1894 /source4/lib
parent47124efe420f4f4f08494cbb2255eacdc9625c8d (diff)
parentd9ad17f945d21d50ea629e22db3ee8758be421a6 (diff)
downloadsamba-b1f85bfb005c4f6c93cf88779e3a12abbd99c973.tar.gz
samba-b1f85bfb005c4f6c93cf88779e3a12abbd99c973.tar.bz2
samba-b1f85bfb005c4f6c93cf88779e3a12abbd99c973.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into manpage
(This used to be commit 8e201ecf3e86c3c8865c7276fad8dad07106efaf)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/crypto/sha256.c23
-rw-r--r--source4/lib/replace/system/kerberos.h5
2 files changed, 24 insertions, 4 deletions
diff --git a/source4/lib/crypto/sha256.c b/source4/lib/crypto/sha256.c
index 70fe7a3099..a2def25814 100644
--- a/source4/lib/crypto/sha256.c
+++ b/source4/lib/crypto/sha256.c
@@ -39,7 +39,6 @@
*/
#include "includes.h"
-#include "heimdal/lib/hcrypto/hash.h"
#include "sha256.h"
#define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z)))
@@ -148,6 +147,26 @@ calc (SHA256_CTX *m, uint32_t *in)
*/
#if !defined(WORDS_BIGENDIAN) || defined(_CRAY)
+/* Vector Crays doesn't have a good 32-bit type, or more precisely,
+ int32_t as defined by <bind/bitypes.h> isn't 32 bits, and we don't
+ want to depend in being able to redefine this type. To cope with
+ this we have to clamp the result in some places to [0,2^32); no
+ need to do this on other machines. Did I say this was a mess?
+ */
+
+#ifdef _CRAY
+#define CRAYFIX(X) ((X) & 0xffffffff)
+#else
+#define CRAYFIX(X) (X)
+#endif
+
+static inline uint32_t
+cshift (uint32_t x, unsigned int n)
+{
+ x = CRAYFIX(x);
+ return CRAYFIX((x << n) | (x >> (32 - n)));
+}
+
static inline uint32_t
swap_uint32_t (uint32_t t)
{
@@ -179,7 +198,7 @@ SHA256_Update (SHA256_CTX *m, const void *v, size_t len)
++m->sz[1];
offset = (old_sz / 8) % 64;
while(len > 0){
- size_t l = min(len, 64 - offset);
+ size_t l = MIN(len, 64 - offset);
memcpy(m->save + offset, p, l);
offset += l;
p += l;
diff --git a/source4/lib/replace/system/kerberos.h b/source4/lib/replace/system/kerberos.h
index 78aa7b943f..2981024bee 100644
--- a/source4/lib/replace/system/kerberos.h
+++ b/source4/lib/replace/system/kerberos.h
@@ -129,8 +129,9 @@
/* Whether krb5_princ_realm returns krb5_realm or krb5_data */
#define KRB5_PRINC_REALM_RETURNS_REALM 1
-#include "heimdal/lib/krb5/krb5.h"
-#include "heimdal/lib/com_err/com_err.h"
+#include <krb5.h>
+#include <com_err.h>
+
#endif
#endif