summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2003-04-30 00:11:40 +0000
committerjbj <devnull@localhost>2003-04-30 00:11:40 +0000
commitac36dd47499046706dc9c464bc1df398fe6a578b (patch)
tree2b6da6975eb0197016b3d134a2952b5409d0bce1
parentd38e3db906459b7a2d9d2d8275d7d4fa8ae0a9e9 (diff)
downloadlibrpm-tizen-ac36dd47499046706dc9c464bc1df398fe6a578b.tar.gz
librpm-tizen-ac36dd47499046706dc9c464bc1df398fe6a578b.tar.bz2
librpm-tizen-ac36dd47499046706dc9c464bc1df398fe6a578b.zip
beecrypt-3.0.0 merge: entropy_noise_gather converts bits-tp-bytes, not words.
CVS patchset: 6791 CVS date: 2003/04/30 00:11:40
-rwxr-xr-xbeecrypt/autogen.sh2
-rw-r--r--beecrypt/base64.c1
-rw-r--r--beecrypt/beecrypt.c2
-rw-r--r--beecrypt/dhaes.c4
-rw-r--r--beecrypt/entropy.c2
-rw-r--r--beecrypt/fips186.c1
-rw-r--r--beecrypt/mtprng.c2
-rw-r--r--beecrypt/tests/Makefile.am4
-rw-r--r--beecrypt/tests/beetest.c17
-rw-r--r--beecrypt/tests/benchbc.c4
-rw-r--r--beecrypt/tests/benchhf.c4
-rw-r--r--beecrypt/tests/benchme.c4
-rw-r--r--beecrypt/tests/openpgp.c17
-rw-r--r--beecrypt/tests/testblowfish.c4
-rw-r--r--beecrypt/tests/testdldp.c4
-rw-r--r--beecrypt/tests/testdsa.c4
-rw-r--r--beecrypt/tests/testhmacmd5.c4
-rw-r--r--beecrypt/tests/testhmacsha1.c4
-rw-r--r--beecrypt/tests/testmd5.c4
-rw-r--r--beecrypt/tests/testrsa.c4
-rw-r--r--beecrypt/tests/testsha1.c4
-rw-r--r--beecrypt/tests/testsha256.c4
22 files changed, 40 insertions, 60 deletions
diff --git a/beecrypt/autogen.sh b/beecrypt/autogen.sh
index b35834fc9..13965a12e 100755
--- a/beecrypt/autogen.sh
+++ b/beecrypt/autogen.sh
@@ -38,7 +38,7 @@ if [ X"$@" = X -a "X`uname -s`" = "XLinux" ]; then
mandir=/usr/man
infodir=/usr/info
fi
- ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --infodir=${infodir} --mandir=${mandir} --enable-static "$@"
+ CPPFLAGS="-Wall -g" ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --infodir=${infodir} --mandir=${mandir} --enable-static "$@"
else
./configure "$@"
fi
diff --git a/beecrypt/base64.c b/beecrypt/base64.c
index 07150a3e5..306ed3d02 100644
--- a/beecrypt/base64.c
+++ b/beecrypt/base64.c
@@ -24,6 +24,7 @@
#include "system.h"
#include "base64.h"
+#include "endianness.h" /* XXX swapu32 for crc */
#include "debug.h"
/*@unchecked@*/
diff --git a/beecrypt/beecrypt.c b/beecrypt/beecrypt.c
index 031db709f..6ce1f905f 100644
--- a/beecrypt/beecrypt.c
+++ b/beecrypt/beecrypt.c
@@ -214,8 +214,6 @@ int randomGeneratorContextInit(randomGeneratorContext* ctxt, const randomGenerat
return -1;
ctxt->rng = rng;
- if (ctxt->param) /* XXX error? */
- free(ctxt->param);
ctxt->param = (randomGeneratorParam*) calloc(rng->paramsize, 1);
/*@-nullstate@*/ /* FIX: ctxt->param may be NULL */
diff --git a/beecrypt/dhaes.c b/beecrypt/dhaes.c
index d341beefa..ecc4a0b9d 100644
--- a/beecrypt/dhaes.c
+++ b/beecrypt/dhaes.c
@@ -203,10 +203,10 @@ static int dhaes_pContextSetup(dhaes_pContext* ctxt, const mpnumber* privkey, co
}
/* compute the hash of the message (ephemeral public) key and the shared secret */
- (void) hashFunctionContextReset (&ctxt->hash);
+ (void) hashFunctionContextReset (&ctxt->hash);
(void) hashFunctionContextUpdateMP(&ctxt->hash, message);
(void) hashFunctionContextUpdateMP(&ctxt->hash, &secret);
- (void) hashFunctionContextDigest (&ctxt->hash, &digest);
+ (void) hashFunctionContextDigest (&ctxt->hash, digest);
/* we don't need the secret anymore */
mpnwipe(&secret);
diff --git a/beecrypt/entropy.c b/beecrypt/entropy.c
index d90518f6b..f7bfee047 100644
--- a/beecrypt/entropy.c
+++ b/beecrypt/entropy.c
@@ -344,7 +344,7 @@ static int entropy_noise_gather(int fd, int samplesize, int channels, int swap,
/*@modifies data, errno, fileSystem @*/
#endif
{
- size_t randombits = ((unsigned)size) << 5;
+ size_t randombits = size << 3;
byte temp = 0;
int rc, i;
diff --git a/beecrypt/fips186.c b/beecrypt/fips186.c
index 18b11ee73..b1f0a2e1a 100644
--- a/beecrypt/fips186.c
+++ b/beecrypt/fips186.c
@@ -25,6 +25,7 @@
#include "system.h"
#include "beecrypt.h"
+#include "endianness.h" /* XXX for encodeInts */
#include "fips186.h"
#include "mpopt.h"
#include "mp.h"
diff --git a/beecrypt/mtprng.c b/beecrypt/mtprng.c
index aa3ef18ab..b01d4ace0 100644
--- a/beecrypt/mtprng.c
+++ b/beecrypt/mtprng.c
@@ -96,7 +96,7 @@ int mtprngSetup(mtprngParam* mp)
mp->left = 0;
- return entropyGatherNext(mp->state, N+1);
+ return entropyGatherNext((byte*)mp->state, N+1);
}
return -1;
}
diff --git a/beecrypt/tests/Makefile.am b/beecrypt/tests/Makefile.am
index 74cd44d52..b973c93b0 100644
--- a/beecrypt/tests/Makefile.am
+++ b/beecrypt/tests/Makefile.am
@@ -27,6 +27,8 @@ LDADD = $(top_builddir)/libbeecrypt.la
TESTS = testmd5 testsha1 testsha256 testhmacmd5 testhmacsha1 testblowfish testrsa testdldp
+staticLDFLAGS = -all-static
+
check_PROGRAMS = testmd5 testsha1 testsha256 testhmacmd5 testhmacsha1 testblowfish testrsa testdldp
testmd5_SOURCES = testmd5.c
@@ -44,6 +46,8 @@ testblowfish_SOURCES = testblowfish.c
testrsa_SOURCES = testrsa.c
testdldp_SOURCES = testdldp.c
+#testdldp_LDADD = $(LDADD) -lpthread
+#testdldp_LDFLAGS = $(staticLDFLAGS)
EXTRA_PROGRAMS = benchme benchhf benchbc
diff --git a/beecrypt/tests/beetest.c b/beecrypt/tests/beetest.c
index 86ecd6adb..863619418 100644
--- a/beecrypt/tests/beetest.c
+++ b/beecrypt/tests/beetest.c
@@ -23,6 +23,8 @@
*
*/
+#include "system.h"
+
#include "beecrypt.h"
#include "blockmode.h"
#include "aes.h"
@@ -39,20 +41,7 @@
#include "sha256.h"
#include "mp.h"
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_STRING_H
-# include <string.h>
-#endif
-#if HAVE_ERRNO_H
-# include <errno.h>
-#endif
-#if HAVE_TIME_H
-# include <time.h>
-#endif
-
-#include <stdio.h>
+#include "debug.h"
/*@unchecked@*/ /*@observer@*/
static const char* dsa_p = "8df2a494492276aa3d25759bb06869cbeac0d83afb8d0cf7cbb8324f0d7882e5d0762fc5b7210eafc2e9adac32ab7aac49693dfbf83724c2ec0736ee31c80291";
diff --git a/beecrypt/tests/benchbc.c b/beecrypt/tests/benchbc.c
index f0191e1bf..f99cfc1af 100644
--- a/beecrypt/tests/benchbc.c
+++ b/beecrypt/tests/benchbc.c
@@ -22,10 +22,10 @@
* \author Bob Deblier <bob.deblier@pandora.be>
*/
+#include "system.h"
#include "beecrypt.h"
#include "timestamp.h"
-
-#include <stdio.h>
+#include "debug.h"
#define SECONDS 10
diff --git a/beecrypt/tests/benchhf.c b/beecrypt/tests/benchhf.c
index 3998c484d..479e13dd1 100644
--- a/beecrypt/tests/benchhf.c
+++ b/beecrypt/tests/benchhf.c
@@ -22,10 +22,10 @@
* \author Bob Deblier <bob.deblier@pandora.be>
*/
-#include <stdio.h>
-
+#include "system.h"
#include "beecrypt.h"
#include "timestamp.h"
+#include "debug.h"
#define SECONDS 10
diff --git a/beecrypt/tests/benchme.c b/beecrypt/tests/benchme.c
index cb6d0ceeb..f42df0d5a 100644
--- a/beecrypt/tests/benchme.c
+++ b/beecrypt/tests/benchme.c
@@ -22,11 +22,11 @@
* \author Bob Deblier <bob.deblier@pandora.be>
*/
-#include <stdio.h>
-
+#include "system.h"
#include "beecrypt.h"
#include "dldp.h"
#include "timestamp.h"
+#include "debug.h"
#define SECONDS 10
diff --git a/beecrypt/tests/openpgp.c b/beecrypt/tests/openpgp.c
index fdebccf4e..9339998f6 100644
--- a/beecrypt/tests/openpgp.c
+++ b/beecrypt/tests/openpgp.c
@@ -4,22 +4,9 @@
static int _debug = 0;
+#include "system.h"
#include "base64.h"
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_STRING_H
-# include <string.h>
-#endif
-#if HAVE_ERRNO_H
-# include <errno.h>
-#endif
-#if HAVE_TIME_H
-# include <time.h>
-#endif
-
-#include <stdio.h>
+#include "debug.h"
static inline int grab(const byte *s, int nbytes)
{
diff --git a/beecrypt/tests/testblowfish.c b/beecrypt/tests/testblowfish.c
index a13533d59..5b1bbb1c2 100644
--- a/beecrypt/tests/testblowfish.c
+++ b/beecrypt/tests/testblowfish.c
@@ -23,9 +23,9 @@
* \ingroup UNIT_m
*/
-#include <stdio.h>
-
+#include "system.h"
#include "blowfish.h"
+#include "debug.h"
struct vector
{
diff --git a/beecrypt/tests/testdldp.c b/beecrypt/tests/testdldp.c
index 4ad5bfc9c..a6e8c27c2 100644
--- a/beecrypt/tests/testdldp.c
+++ b/beecrypt/tests/testdldp.c
@@ -23,10 +23,10 @@
* \ingroup UNIT_m
*/
-#include <stdio.h>
-
+#include "system.h"
#include "beecrypt.h"
#include "dldp.h"
+#include "debug.h"
int main()
{
diff --git a/beecrypt/tests/testdsa.c b/beecrypt/tests/testdsa.c
index b11226a04..d42c4316a 100644
--- a/beecrypt/tests/testdsa.c
+++ b/beecrypt/tests/testdsa.c
@@ -23,11 +23,11 @@
* \ingroup UNIT_m
*/
-#include <stdio.h>
-
+#include "system.h"
#include "beecrypt.h"
#include "dlkp.h"
#include "dsa.h"
+#include "debug.h"
static const char* dsa_p = "8df2a494492276aa3d25759bb06869cbeac0d83afb8d0cf7cbb8324f0d7882e5d0762fc5b7210eafc2e9adac32ab7aac49693dfbf83724c2ec0736ee31c80291";
static const char* dsa_q = "c773218c737ec8ee993b4f2ded30f48edace915f";
diff --git a/beecrypt/tests/testhmacmd5.c b/beecrypt/tests/testhmacmd5.c
index 8c3ac013c..a1e2ee288 100644
--- a/beecrypt/tests/testhmacmd5.c
+++ b/beecrypt/tests/testhmacmd5.c
@@ -24,9 +24,9 @@
* \ingroup UNIT_m
*/
-#include <stdio.h>
-
+#include "system.h"
#include "hmacmd5.h"
+#include "debug.h"
struct vector
{
diff --git a/beecrypt/tests/testhmacsha1.c b/beecrypt/tests/testhmacsha1.c
index dd500943d..1020c199d 100644
--- a/beecrypt/tests/testhmacsha1.c
+++ b/beecrypt/tests/testhmacsha1.c
@@ -24,9 +24,9 @@
* \ingroup UNIT_m
*/
-#include <stdio.h>
-
+#include "system.h"
#include "hmacsha1.h"
+#include "debug.h"
struct vector
{
diff --git a/beecrypt/tests/testmd5.c b/beecrypt/tests/testmd5.c
index ae89d6206..b7776ef76 100644
--- a/beecrypt/tests/testmd5.c
+++ b/beecrypt/tests/testmd5.c
@@ -24,9 +24,9 @@
* \ingroup UNIT_m
*/
-#include <stdio.h>
-
+#include "system.h"
#include "md5.h"
+#include "debug.h"
struct vector
{
diff --git a/beecrypt/tests/testrsa.c b/beecrypt/tests/testrsa.c
index 1dd034b9c..07952b3c7 100644
--- a/beecrypt/tests/testrsa.c
+++ b/beecrypt/tests/testrsa.c
@@ -23,10 +23,10 @@
* \ingroup UNIT_m
*/
-#include <stdio.h>
-
+#include "system.h"
#include "beecrypt.h"
#include "rsa.h"
+#include "debug.h"
static const char* rsa_n = "bbf82f090682ce9c2338ac2b9da871f7368d07eed41043a440d6b6f07454f51fb8dfbaaf035c02ab61ea48ceeb6fcd4876ed520d60e1ec4619719d8a5b8b807fafb8e0a3dfc737723ee6b4b7d93a2584ee6a649d060953748834b2454598394ee0aab12d7b61a51f527a9a41f6c1687fe2537298ca2a8f5946f8e5fd091dbdcb";
static const char* rsa_e = "11";
diff --git a/beecrypt/tests/testsha1.c b/beecrypt/tests/testsha1.c
index af96d1c07..1f00faf56 100644
--- a/beecrypt/tests/testsha1.c
+++ b/beecrypt/tests/testsha1.c
@@ -24,10 +24,10 @@
* \ingroup UNIT_m
*/
-#include <stdio.h>
-
+#include "system.h"
#include "sha1.h"
#include "memchunk.h"
+#include "debug.h"
struct vector
{
diff --git a/beecrypt/tests/testsha256.c b/beecrypt/tests/testsha256.c
index 2ed871ca8..871e0a7c3 100644
--- a/beecrypt/tests/testsha256.c
+++ b/beecrypt/tests/testsha256.c
@@ -21,9 +21,9 @@
*
*/
-#include <stdio.h>
-
+#include "system.h"
#include "sha256.h"
+#include "debug.h"
struct vector
{