Mercurial > dropbear
comparison algo.h @ 1733:d529a52b2f7c coverity coverity
merge coverity from main
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 26 Jun 2020 21:07:34 +0800 |
parents | 41bf8f216644 |
children |
comparison
equal
deleted
inserted
replaced
1643:b59623a64678 | 1733:d529a52b2f7c |
---|---|
45 | 45 |
46 typedef struct Algo_Type algo_type; | 46 typedef struct Algo_Type algo_type; |
47 | 47 |
48 /* lists mapping ssh types of algorithms to internal values */ | 48 /* lists mapping ssh types of algorithms to internal values */ |
49 extern algo_type sshkex[]; | 49 extern algo_type sshkex[]; |
50 extern algo_type sshhostkey[]; | 50 extern algo_type sigalgs[]; |
51 extern algo_type sshciphers[]; | 51 extern algo_type sshciphers[]; |
52 extern algo_type sshhashes[]; | 52 extern algo_type sshhashes[]; |
53 extern algo_type ssh_compress[]; | 53 extern algo_type ssh_compress[]; |
54 extern algo_type ssh_delaycompress[]; | 54 extern algo_type ssh_delaycompress[]; |
55 extern algo_type ssh_nocompress[]; | 55 extern algo_type ssh_nocompress[]; |
70 int keylen, int num_rounds, void *cipher_state); | 70 int keylen, int num_rounds, void *cipher_state); |
71 int (*encrypt)(const unsigned char *pt, unsigned char *ct, | 71 int (*encrypt)(const unsigned char *pt, unsigned char *ct, |
72 unsigned long len, void *cipher_state); | 72 unsigned long len, void *cipher_state); |
73 int (*decrypt)(const unsigned char *ct, unsigned char *pt, | 73 int (*decrypt)(const unsigned char *ct, unsigned char *pt, |
74 unsigned long len, void *cipher_state); | 74 unsigned long len, void *cipher_state); |
75 int (*aead_crypt)(unsigned int seq, | |
76 const unsigned char *in, unsigned char *out, | |
77 unsigned long len, unsigned long taglen, | |
78 void *cipher_state, int direction); | |
79 int (*aead_getlength)(unsigned int seq, | |
80 const unsigned char *in, unsigned int *outlen, | |
81 unsigned long len, void *cipher_state); | |
82 const struct dropbear_hash *aead_mac; | |
75 }; | 83 }; |
76 | 84 |
77 struct dropbear_hash { | 85 struct dropbear_hash { |
78 const struct ltc_hash_descriptor *hash_desc; | 86 const struct ltc_hash_descriptor *hash_desc; |
79 const unsigned long keysize; | 87 const unsigned long keysize; |
110 | 118 |
111 /* both */ | 119 /* both */ |
112 const struct ltc_hash_descriptor *hash_desc; | 120 const struct ltc_hash_descriptor *hash_desc; |
113 }; | 121 }; |
114 | 122 |
115 int have_algo(const char* algo, size_t algolen, const algo_type algos[]); | 123 /* Includes all algorithms is useall is set */ |
124 void buf_put_algolist_all(buffer * buf, const algo_type localalgos[], int useall); | |
125 /* Includes "usable" algorithms */ | |
116 void buf_put_algolist(buffer * buf, const algo_type localalgos[]); | 126 void buf_put_algolist(buffer * buf, const algo_type localalgos[]); |
117 | 127 |
118 enum kexguess2_used { | 128 #define KEXGUESS2_ALGO_NAME "[email protected]" |
119 KEXGUESS2_LOOK, | |
120 KEXGUESS2_NO, | |
121 KEXGUESS2_YES, | |
122 }; | |
123 | 129 |
124 #define KEXGUESS2_ALGO_NAME "[email protected]" | 130 int buf_has_algo(buffer *buf, const char *algo); |
125 #define KEXGUESS2_ALGO_ID 99 | 131 algo_type * first_usable_algo(algo_type algos[]); |
126 | |
127 | |
128 algo_type * buf_match_algo(buffer* buf, algo_type localalgos[], | 132 algo_type * buf_match_algo(buffer* buf, algo_type localalgos[], |
129 enum kexguess2_used *kexguess2, int *goodguess); | 133 int kexguess2, int *goodguess); |
130 | 134 |
131 #if DROPBEAR_USER_ALGO_LIST | 135 #if DROPBEAR_USER_ALGO_LIST |
132 int check_user_algos(const char* user_algo_list, algo_type * algos, | 136 int check_user_algos(const char* user_algo_list, algo_type * algos, |
133 const char *algo_desc); | 137 const char *algo_desc); |
134 char * algolist_string(const algo_type algos[]); | 138 char * algolist_string(const algo_type algos[]); |