mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-14 21:47:19 +02:00
* md.c (md_algo_present): New function to check if a given algo is in use
for a given MD_HANDLE.
This commit is contained in:
parent
c8b8326aae
commit
faed12a698
2 changed files with 22 additions and 2 deletions
18
cipher/md.c
18
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue