Mercurial > dropbear
comparison src/misc/crypt/crypt_find_cipher.c @ 209:39d5d58461d6 libtomcrypt-orig LTC_1.05
Import of libtomcrypt 1.05
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 06 Jul 2005 03:53:40 +0000 |
parents | 1c15b283127b |
children |
comparison
equal
deleted
inserted
replaced
191:1c15b283127b | 209:39d5d58461d6 |
---|---|
22 */ | 22 */ |
23 int find_cipher(const char *name) | 23 int find_cipher(const char *name) |
24 { | 24 { |
25 int x; | 25 int x; |
26 LTC_ARGCHK(name != NULL); | 26 LTC_ARGCHK(name != NULL); |
27 LTC_MUTEX_LOCK(<c_cipher_mutex); | |
27 for (x = 0; x < TAB_SIZE; x++) { | 28 for (x = 0; x < TAB_SIZE; x++) { |
28 if (cipher_descriptor[x].name != NULL && !strcmp(cipher_descriptor[x].name, name)) { | 29 if (cipher_descriptor[x].name != NULL && !strcmp(cipher_descriptor[x].name, name)) { |
30 LTC_MUTEX_UNLOCK(<c_cipher_mutex); | |
29 return x; | 31 return x; |
30 } | 32 } |
31 } | 33 } |
34 LTC_MUTEX_UNLOCK(<c_cipher_mutex); | |
32 return -1; | 35 return -1; |
33 } | 36 } |
34 | 37 |
38 | |
39 /* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_find_cipher.c,v $ */ | |
40 /* $Revision: 1.4 $ */ | |
41 /* $Date: 2005/06/19 18:00:28 $ */ |