Rev 9990 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9990 | Rev 9991 | ||
---|---|---|---|
Line 85... | Line 85... | ||
85 | rep movsd |
85 | rep movsd |
Line 86... | Line 86... | ||
86 | 86 | ||
87 | ;---------------------------------------------- |
87 | ;---------------------------------------------- |
Line 88... | Line 88... | ||
88 | ; >> Send Diffie-Hellman Group Exchange Request |
88 | ; >> Send Diffie-Hellman Group Exchange Request |
89 | 89 | ||
90 | DEBUGF 2, "Sending GEX\n" |
90 | DEBUGF 2, "Sending DH group exchange request\n" |
91 | stdcall sshlib_send_packet, [con_ptr], ssh_msg_gex_req, ssh_msg_gex_req.length, 0 |
91 | stdcall sshlib_send_packet, [con_ptr], ssh_msg_gex_req, ssh_msg_gex_req.length, 0 |
Line 92... | Line 92... | ||
92 | cmp eax, 0 |
92 | cmp eax, 0 |
Line 100... | Line 100... | ||
100 | jl .err |
100 | jl .err |
Line 101... | Line 101... | ||
101 | 101 | ||
102 | mov ebx, [con_ptr] |
102 | mov ebx, [con_ptr] |
103 | cmp [ebx + sshlib_connection.rx_buffer.message_code], SSH_MSG_KEX_DH_GEX_GROUP |
103 | cmp [ebx + sshlib_connection.rx_buffer.message_code], SSH_MSG_KEX_DH_GEX_GROUP |
104 | jne .err_proto |
104 | jne .err_proto |
Line 105... | Line 105... | ||
105 | DEBUGF 2, "Received GEX group\n" |
105 | DEBUGF 2, "Received DH group\n" |
106 | 106 | ||
107 | lea esi, [ebx + sshlib_connection.rx_buffer + sizeof.ssh_packet_header] |
107 | lea esi, [ebx + sshlib_connection.rx_buffer + sizeof.ssh_packet_header] |
108 | stdcall mpint_to_little_endian, [mpint_p], esi |
108 | stdcall mpint_to_little_endian, [mpint_p], esi |
Line 149... | Line 149... | ||
149 | mov byte[ebx + sshlib_connection.tx_buffer.message_code], SSH_MSG_KEX_DH_GEX_INIT |
149 | mov byte[ebx + sshlib_connection.tx_buffer.message_code], SSH_MSG_KEX_DH_GEX_INIT |
150 | lea edi, [ebx + sshlib_connection.tx_buffer.message_code+1] |
150 | lea edi, [ebx + sshlib_connection.tx_buffer.message_code+1] |
151 | stdcall mpint_to_big_endian, edi, [mpint_e] |
151 | stdcall mpint_to_big_endian, edi, [mpint_e] |
Line 152... | Line 152... | ||
152 | 152 | ||
153 | DEBUGF 2, "Sending GEX init\n" |
153 | DEBUGF 2, "Sending GEX init\n" |
154 | mov ecx, dword[ebx + sshlib_connection.tx_buffer.message_code+1] ;;;; dword[edi] |
154 | mov ecx, dword[ebx + sshlib_connection.tx_buffer.message_code+1] |
155 | bswap ecx |
155 | bswap ecx |
156 | add ecx, 5 |
156 | add ecx, 5 |
157 | lea esi, [ebx + sshlib_connection.tx_buffer.message_code] |
157 | lea esi, [ebx + sshlib_connection.tx_buffer.message_code] |
158 | stdcall sshlib_send_packet, [con_ptr], esi, ecx, 0 |
158 | stdcall sshlib_send_packet, [con_ptr], esi, ecx, 0 |
Line 261... | Line 261... | ||
261 | jae @f |
261 | jae @f |
Line 262... | Line 262... | ||
262 | 262 | ||
263 | ; If first KEX, verify host public key |
263 | ; If first KEX, verify host public key |
264 | stdcall sshlib_host_verify, [con_ptr], [str_K_S], [str_s_of_H], [H], SHA2_256_LEN |
264 | stdcall sshlib_host_verify, [con_ptr], [str_K_S], [str_s_of_H], [H], SHA2_256_LEN |
265 | test eax, eax |
265 | test eax, eax |
Line 266... | Line 266... | ||
266 | jnz .err |
266 | jnz .err_hostkey_verification |
267 | 267 | ||
268 | mov eax, [con_ptr] |
268 | mov eax, [con_ptr] |
269 | mov esi, [H] |
269 | mov esi, [H] |
Line 278... | Line 278... | ||
278 | rep movsd |
278 | rep movsd |
Line 279... | Line 279... | ||
279 | 279 | ||
280 | ;------------------------------------- |
280 | ;------------------------------------- |
Line -... | Line 281... | ||
- | 281 | ; << Parse Diffie-Hellman New Keys MSG |
|
- | 282 | ||
281 | ; << Parse Diffie-Hellman New Keys MSG |
283 | DEBUGF 2, "Expecting New Keys message\n" |
282 | 284 | ||
283 | stdcall sshlib_recv_packet, [con_ptr], 0 |
285 | stdcall sshlib_recv_packet, [con_ptr], 0 |
Line 284... | Line 286... | ||
284 | cmp eax, 0 |
286 | cmp eax, 0 |
Line 456... | Line 458... | ||
456 | 458 | ||
457 | mcall 68, 13, [mpint_tmp] |
459 | mcall 68, 13, [mpint_tmp] |
458 | pop eax |
460 | pop eax |
Line -... | Line 461... | ||
- | 461 | ret |
|
- | 462 | ||
- | 463 | .err_hostkey_verification: |
|
- | 464 | DEBUGF 3, "Hostkey verification failed!\n" |
|
459 | ret |
465 | jmp .err |
460 | 466 | ||
461 | .err_nomem: |
467 | .err_nomem: |
462 | DEBUGF 3, "Out of memory during key exchange!\n" |
468 | DEBUGF 3, "Out of memory during key exchange!\n" |