aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-08-07 19:47:57 +0000
committerDavid Shaw <[email protected]>2002-08-07 19:47:57 +0000
commitfaed12a6989447baa7691180f687dc366e03302b (patch)
treebdddb9c2b04f1bef15b9267bc6354113ce579c54
parentFirst test script. Still missing the environment setup. (diff)
downloadgnupg-faed12a6989447baa7691180f687dc366e03302b.tar.gz
gnupg-faed12a6989447baa7691180f687dc366e03302b.zip
* md.c (md_algo_present): New function to check if a given algo is in use
for a given MD_HANDLE.
-rw-r--r--cipher/ChangeLog6
-rw-r--r--cipher/md.c18
2 files changed, 22 insertions, 2 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index 7b8c87f2f..7bda5084f 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,3 +1,8 @@
+2002-08-07 David Shaw <[email protected]>
+
+ * md.c (md_algo_present): New function to check if a given algo is
+ in use for a given MD_HANDLE.
+
2002-08-04 Werner Koch <[email protected]>
* blowfish.h, cast5.h, des.h: Removed after moving all prototypes to
@@ -438,7 +443,6 @@ Mon Oct 4 21:23:04 CEST 1999 Werner Koch <[email protected]>
Sat Sep 18 12:51:51 CEST 1999 Werner Koch <[email protected]>
-
* Makefile.am: Never compile mingw32 as module
Wed Sep 15 14:39:59 CEST 1999 Michael Roth <[email protected]>
diff --git a/cipher/md.c b/cipher/md.c
index 85c1f5b2a..73a2b33cf 100644
--- a/cipher/md.c
+++ b/cipher/md.c
@@ -408,6 +408,23 @@ md_get_algo( MD_HANDLE a )
return 0;
}
+/* Returns true if a given algo is in use in a md */
+int
+md_algo_present( MD_HANDLE a, int algo )
+{
+ struct md_digest_list_s *r=a->list;
+
+ while(r)
+ {
+ if(r->algo==algo)
+ return 1;
+
+ r=r->next;
+ }
+
+ return 0;
+}
+
/****************
* Return the length of the digest
*/
@@ -485,4 +502,3 @@ md_stop_debug( MD_HANDLE md )
}
#endif
}
-