diff options
Diffstat (limited to 'src/Common/Crypto.c')
-rw-r--r-- | src/Common/Crypto.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c index 3b87572a..dd30e488 100644 --- a/src/Common/Crypto.c +++ b/src/Common/Crypto.c | |||
@@ -321,24 +321,28 @@ Cipher *CipherGet (int id) | |||
321 | return NULL; | 321 | return NULL; |
322 | } | 322 | } |
323 | 323 | ||
324 | char *CipherGetName (int cipherId) | 324 | const char *CipherGetName (int cipherId) |
325 | { | 325 | { |
326 | return CipherGet (cipherId) -> Name; | 326 | Cipher* pCipher = CipherGet (cipherId); |
327 | return pCipher? pCipher -> Name : ""; | ||
327 | } | 328 | } |
328 | 329 | ||
329 | int CipherGetBlockSize (int cipherId) | 330 | int CipherGetBlockSize (int cipherId) |
330 | { | 331 | { |
331 | return CipherGet (cipherId) -> BlockSize; | 332 | Cipher* pCipher = CipherGet (cipherId); |
333 | return pCipher? pCipher -> BlockSize : 0; | ||
332 | } | 334 | } |
333 | 335 | ||
334 | int CipherGetKeySize (int cipherId) | 336 | int CipherGetKeySize (int cipherId) |
335 | { | 337 | { |
336 | return CipherGet (cipherId) -> KeySize; | 338 | Cipher* pCipher = CipherGet (cipherId); |
339 | return pCipher? pCipher -> KeySize : 0; | ||
337 | } | 340 | } |
338 | 341 | ||
339 | int CipherGetKeyScheduleSize (int cipherId) | 342 | int CipherGetKeyScheduleSize (int cipherId) |
340 | { | 343 | { |
341 | return CipherGet (cipherId) -> KeyScheduleSize; | 344 | Cipher* pCipher = CipherGet (cipherId); |
345 | return pCipher? pCipher -> KeyScheduleSize : 0; | ||
342 | } | 346 | } |
343 | 347 | ||
344 | #ifndef TC_WINDOWS_BOOT | 348 | #ifndef TC_WINDOWS_BOOT |
@@ -715,15 +719,17 @@ int HashGetIdByName (char *name) | |||
715 | } | 719 | } |
716 | 720 | ||
717 | 721 | ||
718 | char *HashGetName (int hashId) | 722 | const char *HashGetName (int hashId) |
719 | { | 723 | { |
720 | return HashGet (hashId) -> Name; | 724 | Hash* pHash = HashGet(hashId); |
725 | return pHash? pHash -> Name : ""; | ||
721 | } | 726 | } |
722 | 727 | ||
723 | 728 | ||
724 | BOOL HashIsDeprecated (int hashId) | 729 | BOOL HashIsDeprecated (int hashId) |
725 | { | 730 | { |
726 | return HashGet (hashId) -> Deprecated; | 731 | Hash* pHash = HashGet(hashId); |
732 | return pHash? pHash -> Deprecated : FALSE; | ||
727 | } | 733 | } |
728 | 734 | ||
729 | 735 | ||