aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/tiger.c
diff options
context:
space:
mode:
Diffstat (limited to 'cipher/tiger.c')
-rw-r--r--cipher/tiger.c92
1 files changed, 8 insertions, 84 deletions
diff --git a/cipher/tiger.c b/cipher/tiger.c
index 6da715d48..b5e8a8aad 100644
--- a/cipher/tiger.c
+++ b/cipher/tiger.c
@@ -25,7 +25,7 @@
#include <assert.h>
#include "util.h"
#include "memory.h"
-
+#include "algorithms.h"
#ifdef HAVE_U64_TYPEDEF
@@ -879,13 +879,15 @@ tiger_read( TIGER_CONTEXT *hd )
return hd->buf;
}
+#endif /*HAVE_U64_TYPEDEF*/
+
/****************
* Return some information about the algorithm. We need algo here to
* distinguish different flavors of the algorithm.
* Returns: A pointer to string describing the algorithm or NULL if
* the ALGO is invalid.
*/
-static const char *
+const char *
tiger_get_info( int algo, size_t *contextsize,
byte **r_asnoid, int *r_asnlen, int *r_mdlen,
void (**r_init)( void *c ),
@@ -894,6 +896,7 @@ tiger_get_info( int algo, size_t *contextsize,
byte *(**r_read)( void *c )
)
{
+#ifdef HAVE_U64_TYPEDEF
/* 40: SEQUENCE {
* 12: SEQUENCE {
* 8: OCTET STRING :54 49 47 45 52 31 39 32
@@ -904,6 +907,7 @@ tiger_get_info( int algo, size_t *contextsize,
*
* By replacing the 5th byte (0x04) with 0x16 we would have;
* 8: IA5String 'TIGER192'
+ * Fixme: We should use a registered OID.
*/
static byte asn[18] =
{ 0x30, 0x28, 0x30, 0x0c, 0x04, 0x08, 0x54, 0x49, 0x47,
@@ -922,87 +926,7 @@ tiger_get_info( int algo, size_t *contextsize,
*(byte *(**)(TIGER_CONTEXT *))r_read = tiger_read;
return "TIGER192";
-}
-
-
-
-#ifndef IS_MODULE
-static
-#endif
-const char * const gnupgext_version = "TIGER ($Revision$)";
-
-static struct {
- int class;
- int version;
- int value;
- void (*func)(void);
-} func_table[] = {
- { 10, 1, 0, (void(*)(void))tiger_get_info },
- { 11, 1, 6 },
-};
-
-
-
-/****************
- * Enumerate the names of the functions together with informations about
- * this function. Set sequence to an integer with a initial value of 0 and
- * do not change it.
- * If what is 0 all kind of functions are returned.
- * Return values: class := class of function:
- * 10 = message digest algorithm info function
- * 11 = integer with available md algorithms
- * 20 = cipher algorithm info function
- * 21 = integer with available cipher algorithms
- * 30 = public key algorithm info function
- * 31 = integer with available pubkey algorithms
- * version = interface version of the function/pointer
- * (currently this is 1 for all functions)
- */
-#ifndef IS_MODULE
-static
+#else /*!HAVE_U64_TYPEDEF*/
+ return NULL; /* Alorithm not available. */
#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 ) {
- /*fprintf(stderr, "failed\n");*/
- return NULL;
- }
- *class = func_table[i].class;
- *vers = func_table[i].version;
- switch( *class ) {
- case 11:
- case 21:
- case 31:
- ret = &func_table[i].value;
- break;
- default:
- ret = func_table[i].func;
- break;
- }
- i++;
- } while( what && what != *class );
-
- *sequence = i;
- /*fprintf(stderr, "success\n");*/
- return ret;
-}
-
-
-
-#ifndef IS_MODULE
-void
-tiger_constructor(void)
-{
- register_internal_cipher_extension( gnupgext_version,
- gnupgext_enum_func );
}
-#endif
-
-
-#endif /* HAVE_U64_TYPEDEF */
-