11d0096516
$ ./busybox tls kernel.org insize:0 tail:0 got block len:74 got HANDSHAKE got SERVER_HELLO insize:79 tail:4265 got block len:4392 got HANDSHAKE got CERTIFICATE entered der @0x8b217a7:0x30 len:1452 inner_byte @0x8b217ab:0x30 entered der @0x8b217ab:0x30 len:1172 inner_byte @0x8b217af:0xa0 skipped der 0xa0, next byte 0x02 skipped der 0x02, next byte 0x30 skipped der 0x30, next byte 0x30 skipped der 0x30, next byte 0x30 skipped der 0x30, next byte 0x30 skipped der 0x30, next byte 0x30 entered der @0x8b218b4:0x30 len:418 inner_byte @0x8b218b8:0x30 skipped der 0x30, next byte 0x03 entered der @0x8b218c7:0x03 len:399 inner_byte @0x8b218cb:0x00 key bytes:399, first:0x00 entered der @0x8b218cc:0x30 len:394 inner_byte @0x8b218d0:0x02 binary bytes:385, first:0x00 skipped der 0x02, next byte 0x02 binary bytes:3, first:0x01 server_rsa_pub_key.size:384 insize:4397 tail:9 got block len:4 got SERVER_HELLO_DONE insize:9 tail:0 ^C Next step: send CHANGE_CIPHER_SPEC... and actually implement it. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
19 lines
656 B
C
19 lines
656 B
C
/*
|
|
* Copyright (C) 2017 Denys Vlasenko
|
|
*
|
|
* Licensed under GPLv2, see file LICENSE in this source tree.
|
|
*/
|
|
|
|
typedef struct {
|
|
pstm_int e, d, N, qP, dP, dQ, p, q;
|
|
uint32 size; /* Size of the key in bytes */
|
|
int32 optimized; /* 1 for optimized */
|
|
psPool_t *pool;
|
|
} psRsaKey_t;
|
|
|
|
#define psRsaEncryptPub(pool, key, in, inlen, out, outlen, data) \
|
|
psRsaEncryptPub(pool, key, in, inlen, out, outlen)
|
|
int32 psRsaEncryptPub(psPool_t *pool, psRsaKey_t *key,
|
|
unsigned char *in, uint32 inlen,
|
|
unsigned char *out, uint32 outlen, void *data);
|