Mercurial > dropbear
comparison src/misc/crypt/crypt_cipher_is_valid.c @ 210:4768b55c5240 libtomcrypt
propagate from branch 'au.asn.ucc.matt.ltc-orig' (head 33c416b902f1a44913d825bae7ad9a160f703ed3)
to branch 'au.asn.ucc.matt.dropbear.ltc' (head 4d6aec6e6121e13f68c11c149b6579c41cb63e74)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 06 Jul 2005 12:10:23 +0000 |
parents | 39d5d58461d6 |
children |
comparison
equal
deleted
inserted
replaced
199:8be64e2c86f4 | 210:4768b55c5240 |
---|---|
20 @param idx The index of the cipher to search for | 20 @param idx The index of the cipher to search for |
21 @return CRYPT_OK if valid | 21 @return CRYPT_OK if valid |
22 */ | 22 */ |
23 int cipher_is_valid(int idx) | 23 int cipher_is_valid(int idx) |
24 { | 24 { |
25 LTC_MUTEX_LOCK(<c_cipher_mutex); | |
25 if (idx < 0 || idx >= TAB_SIZE || cipher_descriptor[idx].name == NULL) { | 26 if (idx < 0 || idx >= TAB_SIZE || cipher_descriptor[idx].name == NULL) { |
27 LTC_MUTEX_UNLOCK(<c_cipher_mutex); | |
26 return CRYPT_INVALID_CIPHER; | 28 return CRYPT_INVALID_CIPHER; |
27 } | 29 } |
30 LTC_MUTEX_UNLOCK(<c_cipher_mutex); | |
28 return CRYPT_OK; | 31 return CRYPT_OK; |
29 } | 32 } |
33 | |
34 /* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_cipher_is_valid.c,v $ */ | |
35 /* $Revision: 1.4 $ */ | |
36 /* $Date: 2005/06/19 18:00:28 $ */ |