summaryrefslogtreecommitdiffstats
path: root/cipher
diff options
context:
space:
mode:
Diffstat (limited to 'cipher')
-rw-r--r--cipher/ChangeLog8
-rw-r--r--cipher/idea-stub.c11
-rw-r--r--cipher/random.c3
-rw-r--r--cipher/rndriscos.c62
4 files changed, 30 insertions, 54 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index 6599a51bc..98b40ded2 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,3 +1,11 @@
+2002-08-03 Stefan Bellon <sbellon@sbellon.de>
+
+ * idea-stub.c (idea_get_info): RISC OS' Norcroft C needs a cast.
+
+ * random.c (getfnc_gather_random): Added RISC OS support.
+
+ * rndriscos.c: Removed dynload code.
+
2002-08-03 Werner Koch <wk@gnupg.org>
* rndegd.c (do_read): Handle case when read returns 0 to avoid
diff --git a/cipher/idea-stub.c b/cipher/idea-stub.c
index 3a9782037..9dd0ced30 100644
--- a/cipher/idea-stub.c
+++ b/cipher/idea-stub.c
@@ -148,6 +148,13 @@ load_module (const char *name)
return NULL;
}
+#ifdef __riscos__
+typedef
+const char *(*INFO_CAST)(int, size_t*, size_t*, size_t*,
+ int (**)( void *, byte *, unsigned),
+ void (**)( void *, byte *, byte *),
+ void (**)( void *, byte *, byte *));
+#endif /* __riscos__ */
const char *
idea_get_info( int algo, size_t *keylen,
@@ -170,7 +177,11 @@ idea_get_info( int algo, size_t *keylen,
initialized = 1;
for (i=0; (rstr = dynload_enum_module_names (i)); i++)
{
+#ifndef __riscos__
info_fnc = load_module (rstr);
+#else /* __riscos__ */
+ info_fnc = (INFO_CAST) load_module (rstr);
+#endif /* __riscos__ */
if (info_fnc)
break;
}
diff --git a/cipher/random.c b/cipher/random.c
index 1d7bf8a93..d7ebf5787 100644
--- a/cipher/random.c
+++ b/cipher/random.c
@@ -141,6 +141,9 @@ getfnc_gather_random (void))(void (*)(const void*, size_t, int), int,
#ifdef USE_RNDW32
return rndw32_gather_random;
#endif
+#ifdef USE_RNDRISCOS
+ return rndriscos_gather_random;
+#endif
return NULL;
}
diff --git a/cipher/rndriscos.c b/cipher/rndriscos.c
index 47144517a..3aa16d523 100644
--- a/cipher/rndriscos.c
+++ b/cipher/rndriscos.c
@@ -19,6 +19,9 @@
*/
#include <config.h>
+
+#ifdef USE_RNDRISCOS
+
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@@ -26,11 +29,9 @@
#include <kernel.h>
#include <swis.h>
#include "util.h"
-#include "dynload.h"
+#include "algorithms.h"
static int init_device(void);
-static int gather_random(void (*add)(const void*, size_t, int), int requester,
- size_t length, int level);
#define CryptRandom_Byte 0x51980
@@ -67,9 +68,9 @@ init_device(void)
/****************
*/
-static int
-gather_random(void (*add)(const void*, size_t, int), int requester,
- size_t length, int level)
+int
+rndriscos_gather_random(void (*add)(const void*, size_t, int), int requester,
+ size_t length, int level)
{
static int initialized = 0;
int n;
@@ -97,51 +98,4 @@ gather_random(void (*add)(const void*, size_t, int), int requester,
return 0; /* success */
}
-
-
-#ifndef IS_MODULE
-static
-#endif
-const char * const gnupgext_version = "RNDRISCOS ($Revision$)";
-
-static struct {
- int class;
- int version;
- int (*func)(void);
-} func_table[] = {
- { 40, 1, (int (*)(void))gather_random },
-};
-
-
-#ifndef IS_MODULE
-static
-#endif
-void *
-gnupgext_enum_func( int what, int *sequence, int *class, int *vers )
-{
- void *ret;
- int i = *sequence;
-
- do {
- if ( i >= DIM(func_table) || i < 0 ) {
- return NULL;
- }
- *class = func_table[i].class;
- *vers = func_table[i].version;
- ret = (void*) func_table[i].func;
- i++;
- } while ( what && what != *class );
-
- *sequence = i;
- return ret;
-}
-
-#ifndef IS_MODULE
-void
-rndriscos_constructor(void)
-{
- register_internal_cipher_extension( gnupgext_version,
- gnupgext_enum_func );
-}
-#endif
-
+#endif /*USE_RNDRISCOS */