Subversion Repositories Kolibri OS

Rev

Rev 6469 | Rev 7698 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6469 Rev 6922
Line 1... Line 1...
1
;    ssh.asm - SSH client for KolibriOS
1
;    ssh.asm - SSH client for KolibriOS
2
;
2
;
3
;    Copyright (C) 2015-2016 Jeffrey Amelynck
3
;    Copyright (C) 2015-2017 Jeffrey Amelynck
4
;
4
;
5
;    This program is free software: you can redistribute it and/or modify
5
;    This program is free software: you can redistribute it and/or modify
6
;    it under the terms of the GNU General Public License as published by
6
;    it under the terms of the GNU General Public License as published by
7
;    the Free Software Foundation, either version 3 of the License, or
7
;    the Free Software Foundation, either version 3 of the License, or
8
;    (at your option) any later version.
8
;    (at your option) any later version.
Line 29... Line 29...
29
 
29
 
30
        db      'MENUET01'      ; signature
30
        db      'MENUET01'      ; signature
31
        dd      1               ; header version
31
        dd      1               ; header version
32
        dd      start           ; entry point
32
        dd      start           ; entry point
33
        dd      i_end           ; initialized size
33
        dd      i_end           ; initialized size
34
        dd      mem+4096        ; required memory
34
        dd      mem+65536       ; required memory
35
        dd      mem+4096        ; stack pointer
35
        dd      mem+65536       ; stack pointer
36
        dd      params          ; parameters
36
        dd      params          ; parameters
Line 37... Line 37...
37
        dd      0               ; path
37
        dd      0               ; path
38
 
38
 
Line 45... Line 45...
45
include '../../network.inc'
45
include '../../network.inc'
46
include '../../develop/libraries/libcrash/trunk/libcrash.inc'
46
include '../../develop/libraries/libcrash/trunk/libcrash.inc'
Line 47... Line 47...
47
 
47
 
48
include 'mcodes.inc'
48
include 'mcodes.inc'
-
 
49
include 'ssh_transport.inc'
49
include 'ssh_transport.inc'
50
 
Line 50... Line 51...
50
include 'dh_gex.inc'
51
include 'dh_gex.inc'
51
 
52
 
-
 
53
include 'mpint.inc'
52
include 'mpint.inc'
54
include 'random.inc'
53
include 'random.inc'
55
 
54
include 'aes256.inc'
56
include 'aes256.inc'
-
 
57
include 'aes256-ctr.inc'
55
include 'aes256-ctr.inc'
58
include 'aes256-cbc.inc'
-
 
59
 
-
 
60
include 'hmac_sha256.inc'
Line 56... Line 61...
56
include 'aes256-cbc.inc'
61
include 'hmac_sha1.inc'
57
include 'hmac_sha256.inc'
62
include 'hmac_md5.inc'
58
 
63
 
59
; macros for network byte order
64
; macros for network byte order
Line 161... Line 166...
161
                                rb MAX_BITS/8
166
                                rb MAX_BITS/8
Line 162... Line 167...
162
 
167
 
163
        temp_ctx                ctx_sha224256
168
        temp_ctx                ctx_sha224256
Line -... Line 169...
-
 
169
        k_h_ctx                 ctx_sha224256
-
 
170
 
-
 
171
        mpint_tmp               dd ?
164
        k_h_ctx                 ctx_sha224256
172
                                rb MAX_BITS/8
Line 165... Line 173...
165
 
173
 
166
ends
174
ends
Line 690... Line 698...
690
  .length = $ - ssh_kex
698
  .length = $ - ssh_kex
Line 691... Line 699...
691
 
699
 
692
 
700
 
693
ssh_gex_req:
701
ssh_gex_req:
694
        db SSH_MSG_KEX_DH_GEX_REQUEST
702
        db SSH_MSG_KEX_DH_GEX_REQUEST
695
        dd_n 128                        ; DH GEX min
703
        dd_n 8192/4                      ; DH GEX min
696
        dd_n 256                        ; DH GEX number of bits
704
        dd_n 8192/2                      ; DH GEX number of bits
Line 697... Line 705...
697
        dd_n 512                        ; DH GEX Max
705
        dd_n 8192                        ; DH GEX Max
698
  .length = $ - ssh_gex_req
706
  .length = $ - ssh_gex_req
Line 791... Line 799...
791
        con_get_flags,  'con_get_flags'
799
        con_get_flags,  'con_get_flags'
Line 792... Line 800...
792
 
800
 
793
import  libcrash, \
801
import  libcrash, \
794
        sha256_init, 'sha256_init', \
802
        sha256_init, 'sha256_init', \
795
        sha256_update, 'sha256_update', \
803
        sha256_update, 'sha256_update', \
-
 
804
        sha256_final, 'sha256_final',\
-
 
805
        sha1_init, 'sha1_init', \
-
 
806
        sha1_update, 'sha1_update', \
-
 
807
        sha1_final, 'sha1_final', \
-
 
808
        md5_init, 'md5_init', \
-
 
809
        md5_update, 'md5_update', \
Line 796... Line 810...
796
        sha256_final, 'sha256_final'
810
        md5_final, 'md5_final'
Line 797... Line 811...
797
 
811
 
Line 803... Line 817...
803
 
817
 
Line 804... Line 818...
804
params          rb 1024
818
params          rb 1024
Line 805... Line -...
805
 
-
 
806
con             ssh_connection
-
 
807
 
-
 
808
; Temporary values      ; To be removed FIXME
-
 
809
mpint_tmp       rb MPINT_MAX_LEN+4
819