Subversion Repositories Kolibri OS

Rev

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

Rev 9113 Rev 9114
Line 195... Line 195...
195
        jne     .not_sha2
195
        jne     .not_sha2
196
        cmp     dword[esi+12], 'sha2'
196
        cmp     dword[esi+12], 'sha2'
197
        jne     .not_sha2
197
        jne     .not_sha2
198
        cmp     dword[esi+16], '-256'
198
        cmp     dword[esi+16], '-256'
199
        je      .sha2_256
199
        je      .sha2_256
200
;        cmp     dword[esi+16], '-512'
200
        cmp     dword[esi+16], '-512'
201
;        je      .sha2_512
201
        je      .sha2_512
Line 202... Line 202...
202
 
202
 
203
  .not_sha2:
203
  .not_sha2:
Line 204... Line 204...
204
        jmp     .err_signature
204
        jmp     .err_signature
Line 261... Line 261...
261
        rep movsb
261
        rep movsb
Line 262... Line 262...
262
 
262
 
263
        pop     esi
263
        pop     esi
Line -... Line 264...
-
 
264
        jmp     .rsa
-
 
265
 
-
 
266
  .sha2_512:
-
 
267
        DEBUGF  3, "SSH: Using RSA with SHA2-512 hash\n"
-
 
268
        add     esi, 4+4+12
-
 
269
        push    esi
-
 
270
 
-
 
271
; EMSA-PKCS1-v1_5
-
 
272
        invoke  sha512_init, [h_ctx]
-
 
273
        invoke  sha512_update, [h_ctx], [M], [message_len]
-
 
274
        invoke  sha512_final, [h_ctx]
-
 
275
 
-
 
276
        mov     edi, [EM_accent]
-
 
277
        mov     al, 0x00
-
 
278
        stosb
-
 
279
        mov     al, 0x01
-
 
280
        stosb
-
 
281
        mov     ecx, 256 - (rsa_sha512_T.len + 3 + SHA512_HASH_SIZE)
-
 
282
        mov     al, 0xff
-
 
283
        rep stosb
-
 
284
        mov     al, 0x00
-
 
285
        stosb
-
 
286
        mov     esi, rsa_sha512_T
-
 
287
        mov     ecx, rsa_sha512_T.len
-
 
288
        rep movsb
-
 
289
        mov     esi, [h_ctx]
-
 
290
        mov     ecx, SHA512_HASH_SIZE
-
 
291
        rep movsb
-
 
292
 
-
 
293
        pop     esi
264
        jmp     .rsa
294
        jmp     .rsa
265
 
295
 
266
  .rsa:
296
  .rsa:
267
; RSA signature blob
297
; RSA signature blob
268
        stdcall mpint_to_little_endian, [mpint_s], esi
298
        stdcall mpint_to_little_endian, [mpint_s], esi
Line 379... Line 409...
379
        base64_table    db 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
409
        base64_table    db 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
380
        rsa_sha1_T      db 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x04, 0x14
410
        rsa_sha1_T      db 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x04, 0x14
381
        .len = $ - rsa_sha1_T
411
        .len = $ - rsa_sha1_T
382
        rsa_sha256_T    db 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20
412
        rsa_sha256_T    db 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20
383
        .len = $ - rsa_sha256_T
413
        .len = $ - rsa_sha256_T
-
 
414
        rsa_sha512_T    db 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40
-
 
415
        .len = $ - rsa_sha512_T
384
        ssh_rsa_sz      db 'ssh-rsa', 0
416
        ssh_rsa_sz      db 'ssh-rsa', 0
Line 385... Line 417...
385
 
417