[gnutls-devel] GnuTLS | use custom transport with gnutls (#673)
Development of GNU's TLS library
gnutls-devel at lists.gnutls.org
Wed Jan 16 11:28:04 CET 2019
thank you for your reply.
i was already doing this but without [gnutls_transport_set_errno()](https://gnutls.org/manual/gnutls.html#gnutls_005ftransport_005fset_005ferrno) function. unfortunately this produces infinite loop until manual intervention. the problem is that my environment is single threaded therefore client thread is blocked in `waiting to receive` and cannot really let my custom transport send the issued handshake. after handshake is generated in the client both, client and server processes are `waiting to receive` thus blocking the whole program. i will edit my first post to reflect the threading model in my environment.
```
20664: rcvd server -> handshake ...
20664: server level 5 REC[0x7efd500023a0]: Allocating epoch #1
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client gnutls -> handshake ...
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 5 REC[0x7f47c80024d0]: Allocating epoch #1
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 4 HSK[0x7f47c80024d0]: Adv. version: 3.3
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 2 Keeping ciphersuite cc.ac (GNUTLS_ECDHE_PSK_CHACHA20_POLY1305)
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 2 Keeping ciphersuite 00.ab (GNUTLS_DHE_PSK_AES_256_GCM_SHA384)
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 2 Keeping ciphersuite cc.ad (GNUTLS_DHE_PSK_CHACHA20_POLY1305)
20653: client level 2 Keeping ciphersuite c0.a7 (GNUTLS_DHE_PSK_AES_256_CCM)
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 2 Keeping ciphersuite 00.a9 (GNUTLS_PSK_AES_256_GCM_SHA384)
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 2 Keeping ciphersuite cc.ab (GNUTLS_PSK_CHACHA20_POLY1305)
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 2 Keeping ciphersuite c0.a5 (GNUTLS_PSK_AES_256_CCM)
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Maximum Record Size/1) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (OCSP Status Request/5) for 'client hello'
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Client Certificate Type/19) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Server Certificate Type/20) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Supported Groups/10) for 'client hello'
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: Sent group SECP384R1 (0x18)
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 4 EXT[0x7f47c80024d0]: Sent group SECP521R1 (0x19)
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: Sent group FFDHE8192 (0x104)
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: Sending extension Supported Groups/10 (8 bytes)
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Supported EC Point Formats/11) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: Sending extension Supported EC Point Formats/11 (2 bytes)
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (SRP/12) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Signature Algorithms/13) for 'client hello'
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: sent signature algo (5.1) RSA-SHA384
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 4 EXT[0x7f47c80024d0]: sent signature algo (8.10) RSA-PSS-SHA384
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: sent signature algo (8.5) RSA-PSS-RSAE-SHA384
20653: client level 4 EXT[0x7f47c80024d0]: sent signature algo (5.3) ECDSA-SHA384
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: sent signature algo (6.1) RSA-SHA512
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: sent signature algo (8.11) RSA-PSS-SHA512
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: sent signature algo (8.6) RSA-PSS-RSAE-SHA512
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 4 EXT[0x7f47c80024d0]: sent signature algo (6.3) ECDSA-SHA512
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: Sending extension Signature Algorithms/13 (18 bytes)
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (SRTP/14) for 'client hello'
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Heartbeat/15) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (ALPN/16) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Encrypt-then-MAC/22) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: Sending extension Encrypt-then-MAC/22 (0 bytes)
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Extended Master Secret/23) for 'client hello'
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: Sending extension Extended Master Secret/23 (0 bytes)
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Session Ticket/35) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Key Share/51) for 'client hello'
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Supported Versions/43) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Post Handshake Auth/49) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Safe Renegotiation/65281) for 'client hello'
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: Sending extension Safe Renegotiation/65281 (1 bytes)
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Server Name Indication/0) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Cookie/44) for 'client hello'
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Early Data/42) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (PSK Key Exchange Modes/45) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Record Size Limit/28) for 'client hello'
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 EXT[0x7f47c80024d0]: Sending extension Record Size Limit/28 (2 bytes)
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (ClientHello Padding/21) for 'client hello'
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 4 EXT[0x7f47c80024d0]: Preparing extension (Pre Shared Key/41) for 'client hello'
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 4 HSK[0x7f47c80024d0]: CLIENT HELLO was queued [118 bytes]
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 11 HWRITE: enqueued [CLIENT HELLO] 118. Total 118 bytes.
20653: client level 11 HWRITE FLUSH: 118 bytes in buffer.
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 5 REC[0x7f47c80024d0]: Preparing Packet Handshake(22) with length: 118 and min pad: 0
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 9 ENC[0x7f47c80024d0]: cipher: NULL, MAC: MAC-NULL, Epoch: 0
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 11 WRITE: enqueued 123 bytes for 0x7f47e402c990. Total 123 bytes.
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 5 REC[0x7f47c80024d0]: Sent Packet[1] Handshake(22) in epoch 0 and length: 123
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 11 HWRITE: wrote 1 bytes, 0 bytes left.
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 11 WRITE FLUSH: 123 bytes in buffer.
20653: client sending 123 bytes ...
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client sent 123 bytes
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 11 WRITE: wrote 123 bytes, 0 bytes left.
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 10 READ: -1 returned from 0x7f47e402c990, errno=115 gerrno=11
20653: client level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 10 READ: -1 returned from 0x7f47e402c990, errno=115 gerrno=11
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 10 READ: -1 returned from 0x7f47e402c990, errno=115 gerrno=11
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 10 READ: -1 returned from 0x7f47e402c990, errno=115 gerrno=11
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 10 READ: -1 returned from 0x7f47e402c990, errno=115 gerrno=11
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20653: client level 10 READ: -1 returned from 0x7f47e402c990, errno=115 gerrno=11
20664: server level 10 READ: -1 returned from 0x7efd6c02c990, errno=11 gerrno=11
20653: client level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20664: server level 3 ASSERT: ../../lib/buffers.c[_gnutls_io_read_buffered]:589
20653: client level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
20664: server level 3 ASSERT: ../../lib/buffers.c[get_last_packet]:1171
...
```
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/issues/673#note_132011526
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20190116/8c050490/attachment-0001.html>
More information about the Gnutls-devel
mailing list