import ikesemel 1.2
iksemel is an LGPL-licensed XML parser library mainly designed for Jabber applications. ok steven@
This commit is contained in:
parent
e303306b19
commit
03d3f8319b
31
textproc/iksemel/Makefile
Normal file
31
textproc/iksemel/Makefile
Normal file
@ -0,0 +1,31 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2007/09/04 15:05:27 sthen Exp $
|
||||
|
||||
COMMENT= XML parser designed for Jabber applications
|
||||
DISTNAME= iksemel-1.2
|
||||
|
||||
SHARED_LIBS= iksemel 0.0 # .3.0
|
||||
|
||||
CATEGORIES= textproc net
|
||||
|
||||
HOMEPAGE= http://code.google.com/p/iksemel/
|
||||
|
||||
MAINTAINER= Stuart Henderson <stu@spacehopper.org>
|
||||
|
||||
# GPLv2
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
|
||||
MASTER_SITES= http://iksemel.googlecode.com/files/
|
||||
|
||||
WANTLIB= c gcrypt gpg-error iconv intl z
|
||||
LIB_DEPENDS= gnutls.>=12::security/gnutls
|
||||
|
||||
USE_LIBTOOL= Yes
|
||||
CONFIGURE_STYLE= gnu
|
||||
CONFIGURE_ARGS+= ${CONFIGURE_SHARED} \
|
||||
--with-libgnutls-prefix=${LOCALBASE} \
|
||||
CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include"
|
||||
|
||||
.include <bsd.port.mk>
|
5
textproc/iksemel/distinfo
Normal file
5
textproc/iksemel/distinfo
Normal file
@ -0,0 +1,5 @@
|
||||
MD5 (iksemel-1.2.tar.gz) = gufI/bYhGDkka3iMBAp5aw==
|
||||
RMD160 (iksemel-1.2.tar.gz) = MBMlGmcHqscIqfTovkVH4rmkoWY=
|
||||
SHA1 (iksemel-1.2.tar.gz) = Yk1ae96fjoE3MWUTuV1TE7A/nQY=
|
||||
SHA256 (iksemel-1.2.tar.gz) = pgbiMLItnQKZmLhOXWMRqLo1owT+RX4lTrX9GZQ81jk=
|
||||
SIZE (iksemel-1.2.tar.gz) = 429405
|
14
textproc/iksemel/patches/patch-doc_iksemel
Normal file
14
textproc/iksemel/patches/patch-doc_iksemel
Normal file
@ -0,0 +1,14 @@
|
||||
$OpenBSD: patch-doc_iksemel,v 1.1.1.1 2007/09/04 15:05:27 sthen Exp $
|
||||
--- doc/iksemel.orig Thu Aug 5 14:31:16 2004
|
||||
+++ doc/iksemel Tue Sep 4 15:24:12 2007
|
||||
@@ -1,5 +1,10 @@
|
||||
This is iksemel, produced by makeinfo version 4.6 from iksemel.texi.
|
||||
|
||||
+INFO-DIR-SECTION Libraries
|
||||
+START-INFO-DIR-ENTRY
|
||||
+* iksemel: (iksemel). A library of jabber/XML functions
|
||||
+END-INFO-DIR-ENTRY
|
||||
+
|
||||
|
||||
File: iksemel, Node: Top, Up: (dir)
|
||||
|
188
textproc/iksemel/patches/patch-src_md5_c
Normal file
188
textproc/iksemel/patches/patch-src_md5_c
Normal file
@ -0,0 +1,188 @@
|
||||
$OpenBSD: patch-src_md5_c,v 1.1.1.1 2007/09/04 15:05:27 sthen Exp $
|
||||
--- src/md5.c.orig Tue Sep 4 15:24:44 2007
|
||||
+++ src/md5.c Tue Sep 4 15:41:02 2007
|
||||
@@ -4,72 +4,20 @@
|
||||
** modify it under the terms of GNU Lesser General Public License.
|
||||
*/
|
||||
|
||||
+#include <sys/types.h>
|
||||
+#include <md5.h>
|
||||
+
|
||||
#include "common.h"
|
||||
#include "iksemel.h"
|
||||
|
||||
-#define GET_UINT32(n,b,i) { \
|
||||
- (n) = ( (unsigned long int) (b)[(i) ] ) \
|
||||
- | ( (unsigned long int) (b)[(i) + 1] << 8 ) \
|
||||
- | ( (unsigned long int) (b)[(i) + 2] << 16 ) \
|
||||
- | ( (unsigned long int) (b)[(i) + 3] << 24 ); \
|
||||
-}
|
||||
-
|
||||
-#define PUT_UINT32(n,b,i) { \
|
||||
- (b)[(i) ] = (unsigned char) ( (n) ); \
|
||||
- (b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \
|
||||
- (b)[(i) + 2] = (unsigned char) ( (n) >> 16 ); \
|
||||
- (b)[(i) + 3] = (unsigned char) ( (n) >> 24 ); \
|
||||
-}
|
||||
-
|
||||
-#define F(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
|
||||
-
|
||||
-#define G(x,y,z) ((y) ^ ((z) & ((x) ^ (y))))
|
||||
-
|
||||
-#define H(x,y,z) ((x) ^ (y) ^ (z))
|
||||
-
|
||||
-#define I(x,y,z) ((y) ^ ((x) | ~(z)))
|
||||
-
|
||||
-#define S(x,n) (((x) << (n)) | (((x) & 0xFFFFFFFF) >> (32 - (n))))
|
||||
-
|
||||
-#define P(r,i,f,k,s,t) { \
|
||||
- r[i] += f(r[((i)+1)%4],r[((i)+2)%4],r[((i)+3)%4]) + X[k] + t; \
|
||||
- r[i] = S(r[i],s) + r[((i)+1)%4]; \
|
||||
-}
|
||||
-
|
||||
struct iksmd5_struct {
|
||||
- unsigned long int total[2];
|
||||
- unsigned long int state[4];
|
||||
- unsigned char buffer[64];
|
||||
- unsigned char blen;
|
||||
+ MD5_CTX context;
|
||||
};
|
||||
|
||||
-static unsigned long int T[] =
|
||||
- { 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee,
|
||||
- 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
|
||||
- 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,
|
||||
- 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,
|
||||
- 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,
|
||||
- 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,
|
||||
- 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed,
|
||||
- 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,
|
||||
- 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c,
|
||||
- 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
|
||||
- 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05,
|
||||
- 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,
|
||||
- 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039,
|
||||
- 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,
|
||||
- 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
|
||||
- 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 };
|
||||
-
|
||||
-static void iks_md5_compute(iksmd5 *md5);
|
||||
-
|
||||
void iks_md5_reset(iksmd5 *md5)
|
||||
{
|
||||
memset(md5, 0, sizeof(iksmd5));
|
||||
- md5->state[0] = 0x67452301;
|
||||
- md5->state[1] = 0xEFCDAB89;
|
||||
- md5->state[2] = 0x98BADCFE;
|
||||
- md5->state[3] = 0x10325476;
|
||||
+ MD5Init(&md5->context);
|
||||
}
|
||||
|
||||
iksmd5 *iks_md5_new(void)
|
||||
@@ -84,42 +32,8 @@ iksmd5 *iks_md5_new(void)
|
||||
|
||||
void iks_md5_hash(iksmd5 *md5, const unsigned char *data, size_t slen, int finish)
|
||||
{
|
||||
- int i, j;
|
||||
- int len = slen;
|
||||
-
|
||||
- i = (64 - md5->blen);
|
||||
- j = (len < i) ? (len) : (i);
|
||||
- memcpy(md5->buffer + md5->blen, data, j);
|
||||
- md5->blen += j;
|
||||
- len -= j;
|
||||
- data += j;
|
||||
- while (len > 0) {
|
||||
- iks_md5_compute(md5);
|
||||
- md5->blen = 0;
|
||||
- md5->total[0] += 8*64;
|
||||
- md5->total[1] += (md5->total[0] < 8*64);
|
||||
- j = (len < 64) ? (len) : (64);
|
||||
- memcpy(md5->buffer, data, j);
|
||||
- md5->blen = j;
|
||||
- len -= j;
|
||||
- data += j;
|
||||
- }
|
||||
- if (finish) {
|
||||
- md5->total[0] += 8*md5->blen;
|
||||
- md5->total[1] += (md5->total[0] < 8*md5->blen);
|
||||
- md5->buffer[(md5->blen)++] = 0x80;
|
||||
- if (md5->blen > 56) {
|
||||
- while (md5->blen < 64)
|
||||
- md5->buffer[(md5->blen)++] = 0x00;
|
||||
- iks_md5_compute(md5);
|
||||
- md5->blen = 0;
|
||||
- }
|
||||
- while (md5->blen < 56)
|
||||
- md5->buffer[(md5->blen)++] = 0x00;
|
||||
- PUT_UINT32(md5->total[0], md5->buffer, 56);
|
||||
- PUT_UINT32(md5->total[1], md5->buffer, 60);
|
||||
- iks_md5_compute(md5);
|
||||
- }
|
||||
+ if (data && slen != 0)
|
||||
+ MD5Update(&md5->context, data, slen);
|
||||
}
|
||||
|
||||
void iks_md5_delete(iksmd5 *md5)
|
||||
@@ -129,22 +43,12 @@ void iks_md5_delete(iksmd5 *md5)
|
||||
|
||||
void iks_md5_digest(iksmd5 *md5, unsigned char *digest)
|
||||
{
|
||||
- PUT_UINT32(md5->state[0], digest, 0);
|
||||
- PUT_UINT32(md5->state[1], digest, 4);
|
||||
- PUT_UINT32(md5->state[2], digest, 8);
|
||||
- PUT_UINT32(md5->state[3], digest, 12);
|
||||
+ MD5Final(digest, &md5->context);
|
||||
}
|
||||
|
||||
void iks_md5_print(iksmd5 *md5, char *buf)
|
||||
{
|
||||
- int i;
|
||||
- unsigned char digest[16];
|
||||
-
|
||||
- iks_md5_digest(md5, digest);
|
||||
- for (i = 0; i < 16; i++) {
|
||||
- sprintf (buf, "%02x", digest[i]);
|
||||
- buf += 2;
|
||||
- }
|
||||
+ MD5End(&md5->context, buf);
|
||||
}
|
||||
|
||||
void iks_md5(const char *data, char *buf)
|
||||
@@ -154,36 +58,5 @@ void iks_md5(const char *data, char *buf)
|
||||
iks_md5_hash(md5, data, strlen(data), 1);
|
||||
iks_md5_print(md5, buf);
|
||||
iks_md5_delete(md5);
|
||||
-}
|
||||
-
|
||||
-static void iks_md5_compute(iksmd5 *md5)
|
||||
-{
|
||||
- unsigned long int X[16], R[4];
|
||||
- unsigned char RS1[] = { 7, 12 ,17, 22 };
|
||||
- unsigned char RS2[] = { 5, 9 ,14, 20 };
|
||||
- unsigned char RS3[] = { 4, 11 ,16, 23 };
|
||||
- unsigned char RS4[] = { 6, 10 ,15, 21 };
|
||||
- int i, j, k, p;
|
||||
-
|
||||
- for (i = 0; i < 16; ++i)
|
||||
- GET_UINT32(X[i], md5->buffer, i*4);
|
||||
-
|
||||
- for (i = 0; i < 4; ++i)
|
||||
- R[i] = md5->state[i];
|
||||
-
|
||||
- for (i = j = k = 0; i < 16; ++i, j = i%4, k = (k+3)%4)
|
||||
- P(R, k, F, i, RS1[j], T[i]);
|
||||
-
|
||||
- for (i = j = k = 0, p = 1; i < 16; ++i, j = i%4, k = (k+3)%4, p = (p+5)%16)
|
||||
- P(R, k, G, p, RS2[j], T[i+16]);
|
||||
-
|
||||
- for (i = j = k = 0, p = 5; i < 16; ++i, j = i%4, k = (k+3)%4, p = (p+3)%16)
|
||||
- P(R, k, H, p, RS3[j], T[i+32]);
|
||||
-
|
||||
- for (i = j = k = p = 0; i < 16; ++i, j = i%4, k = (k+3)%4, p = (p+7)%16)
|
||||
- P(R, k, I, p, RS4[j], T[i+48]);
|
||||
-
|
||||
- for (i = 0; i < 4; ++i)
|
||||
- md5->state[i] += R[i];
|
||||
}
|
||||
|
141
textproc/iksemel/patches/patch-src_sha_c
Normal file
141
textproc/iksemel/patches/patch-src_sha_c
Normal file
@ -0,0 +1,141 @@
|
||||
$OpenBSD: patch-src_sha_c,v 1.1.1.1 2007/09/04 15:05:27 sthen Exp $
|
||||
--- src/sha.c.orig Wed Apr 28 20:35:57 2004
|
||||
+++ src/sha.c Thu Jul 26 16:28:32 2007
|
||||
@@ -4,17 +4,14 @@
|
||||
** modify it under the terms of GNU Lesser General Public License.
|
||||
*/
|
||||
|
||||
+#include <sys/types.h>
|
||||
+#include <sha1.h>
|
||||
+
|
||||
#include "common.h"
|
||||
#include "iksemel.h"
|
||||
|
||||
-static void sha_buffer (iksha *sha, const unsigned char *data, int len);
|
||||
-static void sha_calculate (iksha *sha);
|
||||
-
|
||||
struct iksha_struct {
|
||||
- unsigned long hash[5];
|
||||
- unsigned long buf[80];
|
||||
- int blen;
|
||||
- unsigned long lenhi, lenlo;
|
||||
+ SHA1_CTX context;
|
||||
};
|
||||
|
||||
iksha *
|
||||
@@ -32,51 +29,20 @@ void
|
||||
iks_sha_reset (iksha *sha)
|
||||
{
|
||||
memset (sha, 0, sizeof (iksha));
|
||||
- sha->hash[0] = 0x67452301L;
|
||||
- sha->hash[1] = 0xefcdab89L;
|
||||
- sha->hash[2] = 0x98badcfeL;
|
||||
- sha->hash[3] = 0x10325476L;
|
||||
- sha->hash[4] = 0xc3d2e1f0L;
|
||||
+ SHA1Init(&sha->context);
|
||||
}
|
||||
|
||||
void
|
||||
iks_sha_hash (iksha *sha, const unsigned char *data, size_t len, int finish)
|
||||
{
|
||||
- unsigned char pad[8];
|
||||
- unsigned char padc;
|
||||
-
|
||||
- if (data && len != 0) sha_buffer (sha, data, len);
|
||||
- if (!finish) return;
|
||||
-
|
||||
- pad[0] = (unsigned char)((sha->lenhi >> 24) & 0xff);
|
||||
- pad[1] = (unsigned char)((sha->lenhi >> 16) & 0xff);
|
||||
- pad[2] = (unsigned char)((sha->lenhi >> 8) & 0xff);
|
||||
- pad[3] = (unsigned char)(sha->lenhi & 0xff);
|
||||
- pad[4] = (unsigned char)((sha->lenlo >> 24) & 0xff);
|
||||
- pad[5] = (unsigned char)((sha->lenlo >> 16) & 0xff);
|
||||
- pad[6] = (unsigned char)((sha->lenlo >> 8) & 0xff);
|
||||
- pad[7] = (unsigned char)(sha->lenlo & 255);
|
||||
-
|
||||
- padc = 0x80;
|
||||
- sha_buffer (sha, &padc, 1);
|
||||
-
|
||||
- padc = 0x00;
|
||||
- while (sha->blen != 56)
|
||||
- sha_buffer (sha, &padc, 1);
|
||||
-
|
||||
- sha_buffer (sha, pad, 8);
|
||||
+ if (data && len != 0)
|
||||
+ SHA1Update(&sha->context, data, len);
|
||||
}
|
||||
|
||||
void
|
||||
iks_sha_print (iksha *sha, char *hash)
|
||||
{
|
||||
- int i;
|
||||
-
|
||||
- for (i=0; i<5; i++)
|
||||
- {
|
||||
- sprintf (hash, "%08lx", sha->hash[i]);
|
||||
- hash += 8;
|
||||
- }
|
||||
+ SHA1End(&sha->context, hash);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -94,59 +60,4 @@ iks_sha (const char *data, char *hash)
|
||||
iks_sha_hash (sha, data, strlen (data), 1);
|
||||
iks_sha_print (sha, hash);
|
||||
iks_free (sha);
|
||||
-}
|
||||
-
|
||||
-static void
|
||||
-sha_buffer (iksha *sha, const unsigned char *data, int len)
|
||||
-{
|
||||
- int i;
|
||||
-
|
||||
- for (i=0; i<len; i++) {
|
||||
- sha->buf[sha->blen / 4] <<= 8;
|
||||
- sha->buf[sha->blen / 4] |= (unsigned long)data[i];
|
||||
- if ((++sha->blen) % 64 == 0) {
|
||||
- sha_calculate (sha);
|
||||
- sha->blen = 0;
|
||||
- }
|
||||
- sha->lenlo += 8;
|
||||
- sha->lenhi += (sha->lenlo < 8);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-#define SRL(x,y) (((x) << (y)) | ((x) >> (32-(y))))
|
||||
-#define SHA(a,b,f,c) \
|
||||
- for (i= (a) ; i<= (b) ; i++) { \
|
||||
- TMP = SRL(A,5) + ( (f) ) + E + sha->buf[i] + (c) ; \
|
||||
- E = D; \
|
||||
- D = C; \
|
||||
- C = SRL(B,30); \
|
||||
- B = A; \
|
||||
- A = TMP; \
|
||||
- }
|
||||
-
|
||||
-static void
|
||||
-sha_calculate (iksha *sha)
|
||||
-{
|
||||
- int i;
|
||||
- unsigned long A, B, C, D, E, TMP;
|
||||
-
|
||||
- for (i=16; i<80; i++)
|
||||
- sha->buf[i] = SRL (sha->buf[i-3] ^ sha->buf[i-8] ^ sha->buf[i-14] ^ sha->buf[i-16], 1);
|
||||
-
|
||||
- A = sha->hash[0];
|
||||
- B = sha->hash[1];
|
||||
- C = sha->hash[2];
|
||||
- D = sha->hash[3];
|
||||
- E = sha->hash[4];
|
||||
-
|
||||
- SHA (0, 19, ((C^D)&B)^D, 0x5a827999L);
|
||||
- SHA (20, 39, B^C^D, 0x6ed9eba1L);
|
||||
- SHA (40, 59, (B&C)|(D&(B|C)), 0x8f1bbcdcL);
|
||||
- SHA (60, 79, B^C^D, 0xca62c1d6L);
|
||||
-
|
||||
- sha->hash[0] += A;
|
||||
- sha->hash[1] += B;
|
||||
- sha->hash[2] += C;
|
||||
- sha->hash[3] += D;
|
||||
- sha->hash[4] += E;
|
||||
}
|
6
textproc/iksemel/pkg/DESCR
Normal file
6
textproc/iksemel/pkg/DESCR
Normal file
@ -0,0 +1,6 @@
|
||||
iksemel is an LGPL-licensed XML parser library mainly designed for
|
||||
Jabber applications.
|
||||
|
||||
It provides SAX, DOM, and special Jabber stream APIs. Library is
|
||||
coded in ANSI C except the network code (which is POSIX compatible),
|
||||
thus highly portable.
|
2
textproc/iksemel/pkg/PFRAG.shared
Normal file
2
textproc/iksemel/pkg/PFRAG.shared
Normal file
@ -0,0 +1,2 @@
|
||||
@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2007/09/04 15:05:27 sthen Exp $
|
||||
@lib lib/libiksemel.so.${LIBiksemel_VERSION}
|
11
textproc/iksemel/pkg/PLIST
Normal file
11
textproc/iksemel/pkg/PLIST
Normal file
@ -0,0 +1,11 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2007/09/04 15:05:27 sthen Exp $
|
||||
%%SHARED%%
|
||||
bin/ikslint
|
||||
bin/iksperf
|
||||
bin/iksroster
|
||||
include/iksemel.h
|
||||
@info info/iksemel
|
||||
lib/libiksemel.a
|
||||
lib/libiksemel.la
|
||||
lib/pkgconfig/
|
||||
lib/pkgconfig/iksemel.pc
|
Loading…
Reference in New Issue
Block a user