FreeBSD Bugzilla – Attachment 63681 Details for
Bug 94921
isakmpd fails on amd64
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.89 KB, created by
Mats Palmgren
on 2006-03-25 03:10:13 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Mats Palmgren
Created:
2006-03-25 03:10:13 UTC
Size:
3.89 KB
patch
obsolete
>diff -rpu8 sysdep/common/libsysdep/sha1.c sysdep-FIXED/common/libsysdep/sha1.c >--- sysdep/common/libsysdep/sha1.c Sun Jan 28 23:38:48 2001 >+++ sysdep-FIXED/common/libsysdep/sha1.c Sat Mar 25 02:48:19 2006 >@@ -46,22 +46,22 @@ A million repetitions of "a" > #define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); > #define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); > #define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); > #define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); > > > /* Hash a single 512-bit block. This is the core of the algorithm. */ > >-void SHA1Transform(unsigned long state[5], unsigned char buffer[64]) >+void SHA1Transform(UINT4 state[5], unsigned char buffer[64]) > { >-unsigned long a, b, c, d, e; >+UINT4 a, b, c, d, e; > typedef union { > unsigned char c[64]; >- unsigned long l[16]; >+ UINT4 l[16]; > } CHAR64LONG16; > CHAR64LONG16* block; > #ifdef SHA1HANDSOFF > static CHAR64LONG16 workspace; > block = &workspace; > memcpy(block, buffer, 64); > #else > block = (CHAR64LONG16*)buffer; >@@ -118,17 +118,17 @@ void SHA1Init(SHA1_CTX* context) > } > > > /* Run your data through this. */ > > void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len) > { > unsigned int i; >-unsigned long j; >+UINT4 j; > > j = context->count[0]; > if ((context->count[0] += len << 3) < j) context->count[1] += (len>>29)+1; > j = (j >> 3) & 63; > if ((j + len) > 63) { > memcpy(&context->buffer[j], data, (i = 64-j)); > SHA1Transform(context->state, context->buffer); > for ( ; i + 63 < len; i += 64) { >@@ -140,17 +140,17 @@ unsigned long j; > memcpy(&context->buffer[j], &data[i], len - i); > } > > > /* Add padding and return the message digest. */ > > void SHA1Final(unsigned char digest[20], SHA1_CTX* context) > { >-unsigned long i, j; >+UINT4 i, j; > unsigned char finalcount[8]; > > for (i = 0; i < 8; i++) { > finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] > >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ > } > SHA1Update(context, (unsigned char *)"\200", 1); > while ((context->count[0] & 504) != 448) { >diff -rpu8 sysdep/common/md5.h sysdep-FIXED/common/md5.h >--- sysdep/common/md5.h Sun Jan 28 23:38:47 2001 >+++ sysdep-FIXED/common/md5.h Sat Mar 25 02:47:19 2006 >@@ -7,24 +7,26 @@ > function argument prototyping. > The following makes PROTOTYPES default to 0 if it has not already > been defined with C compiler flags. > */ > #ifndef PROTOTYPES > #define PROTOTYPES 1 > #endif > >+#include <sys/types.h> >+ > /* POINTER defines a generic pointer type */ > typedef unsigned char *POINTER; > > /* UINT2 defines a two byte word */ >-typedef unsigned short int UINT2; >+typedef u_int16_t UINT2; > > /* UINT4 defines a four byte word */ >-typedef unsigned long int UINT4; >+typedef u_int32_t UINT4; > > /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. > If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it > returns an empty list. > */ > > #if PROTOTYPES > #define PROTO_LIST(list) list >diff -rpu8 sysdep/common/sha1.h sysdep-FIXED/common/sha1.h >--- sysdep/common/sha1.h Sun Jan 28 23:38:47 2001 >+++ sysdep-FIXED/common/sha1.h Sat Mar 25 02:47:12 2006 >@@ -1,18 +1,22 @@ > /* $OpenBSD: sha1.h,v 1.2 2001/01/28 22:38:47 niklas Exp $ */ > > /* > SHA-1 in C > By Steve Reid <steve@edmweb.com> > 100% Public Domain > */ > >+#include <sys/types.h> >+ >+typedef u_int32_t UINT4; >+ > typedef struct { >- unsigned long state[5]; >- unsigned long count[2]; >+ UINT4 state[5]; >+ UINT4 count[2]; > unsigned char buffer[64]; > } SHA1_CTX; > >-void SHA1Transform(unsigned long state[5], unsigned char buffer[64]); >+void SHA1Transform(UINT4 state[5], unsigned char buffer[64]); > void SHA1Init(SHA1_CTX* context); > void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len); > void SHA1Final(unsigned char digest[20], SHA1_CTX* context);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 94921
: 63681