comparison sysoptions.h @ 715:cd3d3c63d189

Make hmac-sha2-256 and hmac-sha2-512 work
author Matt Johnston <matt@ucc.asn.au>
date Thu, 21 Mar 2013 22:55:12 +0800
parents 91dd8328a3ff
children 9644f50434f1
comparison
equal deleted inserted replaced
714:84157e435c52 715:cd3d3c63d189
74 /* Required for pubkey auth */ 74 /* Required for pubkey auth */
75 #if defined(ENABLE_SVR_PUBKEY_AUTH) || defined(DROPBEAR_CLIENT) 75 #if defined(ENABLE_SVR_PUBKEY_AUTH) || defined(DROPBEAR_CLIENT)
76 #define DROPBEAR_SIGNKEY_VERIFY 76 #define DROPBEAR_SIGNKEY_VERIFY
77 #endif 77 #endif
78 78
79 /* SHA1 is 20 bytes == 160 bits */
80 #define SHA1_HASH_SIZE 20 79 #define SHA1_HASH_SIZE 20
81 /* SHA512 is 64 bytes == 512 bits */
82 #define SHA512_HASH_SIZE 64
83 /* MD5 is 16 bytes = 128 bits */
84 #define MD5_HASH_SIZE 16 80 #define MD5_HASH_SIZE 16
85
86 /* largest of MD5 and SHA1 */
87 #define MAX_MAC_LEN SHA1_HASH_SIZE
88
89 81
90 #define MAX_KEY_LEN 32 /* 256 bits for aes256 etc */ 82 #define MAX_KEY_LEN 32 /* 256 bits for aes256 etc */
91 #define MAX_IV_LEN 20 /* must be same as max blocksize, 83 #define MAX_IV_LEN 20 /* must be same as max blocksize,
92 and >= SHA1_HASH_SIZE */ 84 and >= SHA1_HASH_SIZE */
85
93 #if defined(DROPBEAR_SHA2_512_HMAC) 86 #if defined(DROPBEAR_SHA2_512_HMAC)
94 #define MAX_MAC_KEY 64 87 #define MAX_MAC_LEN 64
95 #elif defined(DROPBEAR_SHA2_256_HMAC) 88 #elif defined(DROPBEAR_SHA2_256_HMAC)
96 #define MAX_MAC_KEY 32 89 #define MAX_MAC_LEN 32
97 #else 90 #else
98 #define MAX_MAC_KEY 20 91 #define MAX_MAC_LEN 20
99 #endif 92 #endif
100 93
101 #define MAX_NAME_LEN 64 /* maximum length of a protocol name, isn't 94 #define MAX_NAME_LEN 64 /* maximum length of a protocol name, isn't
102 explicitly specified for all protocols (just 95 explicitly specified for all protocols (just
103 for algos) but seems valid */ 96 for algos) but seems valid */