LWIP packet length - tcp
I have a problem with the mbedtls server (stm32+lwip) send wrong length message. I am using this code in my project.
https://github.com/straight-coding/straight-httpd-lwip-mbedtls-simulator
Server hello message include 150 byte message but in the packet details this message should be 576 byte.
When I checked the low_level_output function I can only see 150 byte data, why the packet length is wrong ? How can I solve the problem ?
This is mbedtls debug output:
line, 2 level,file message: => handshake
: 4458 line, 2 level,file message: server state: 0
: 2080 line, 2 level,file t message: => flush output
: 2092 line, 2 level,file t message: <= flush output
: 4458 line, 2 level,file message: server state: 1
: 2080 line, 2 level,file t message: => flush output
: 2092 line, 2 level,file t message: <= flush output
: 1325 line, 2 level,file message: => parse client hello
: 1860 line, 2 level,file t message: => fetch input
: 2022 line, 2 level,file t message: in_left: 0, nb_want: 5
: 2046 line, 2 level,file t message: in_left: 0, nb_want: 5
: 2047 line, 2 level,file t message: ssl->f_recv(_timeout)() returned 5 (-0xfffffffb)
: 2067 line, 2 level,file t message: <= fetch input
: 1357 line, 4 level,file message: dumping 'record header' (5 bytes)
: 1357 line, 4 level,file message: 0000: 16 03 01 00 cb .....
: 1369 line, 3 level,file message: client hello v3, message type: 22
: 1378 line, 3 level,file message: client hello v3, message len.: 203
: 1381 line, 3 level,file message: client hello v3, protocol version: [3:1]
: 1860 line, 2 level,file t message: => fetch input
: 2022 line, 2 level,file t message: in_left: 5, nb_want: 208
: 2046 line, 2 level,file t message: in_left: 5, nb_want: 208
: 2047 line, 2 level,file t message: ssl->f_recv(_timeout)() returned 203 (-0xffffff35)
: 2067 line, 2 level,file t message: <= fetch input
: 1463 line, 4 level,file message: dumping 'record contents' (203 bytes)
: 1463 line, 4 level,file message: 0000: 01 00 00 c7 03 03 33 89 ee 0a c8 f4 8d 69 14 00 ......3......i..
: 1463 line, 4 level,file message: 0010: 2d 50 69 44 70 4f fa 47 8e 73 e5 76 cf 2c 5a 63 -PiDpO.G.s.v.,Zc
: 1463 line, 4 level,file message: 0020: 8f 78 af 8b 26 0f 00 00 38 c0 2c c0 30 00 9f cc .x..&...8.,.0...
: 1463 line, 4 level,file message: 0030: a9 cc a8 cc aa c0 2b c0 2f 00 9e c0 24 c0 28 00 ......+./...$.(.
: 1463 line, 4 level,file message: 0040: 6b c0 23 c0 27 00 67 c0 0a c0 14 00 39 c0 09 c0 k.#.'.g.....9...
: 1463 line, 4 level,file message: 0050: 13 00 33 00 9d 00 9c 00 3d 00 3c 00 35 00 2f 00 ..3.....=.<.5./.
: 1463 line, 4 level,file message: 0060: ff 01 00 00 66 00 00 00 10 00 0e 00 00 0b 65 78 ....f.........ex
: 1463 line, 4 level,file message: 0070: 61 6d 70 6c 65 2e 6f 72 67 00 0b 00 04 03 00 01 ample.org.......
: 1463 line, 4 level,file message: 0080: 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 ................
: 1463 line, 4 level,file message: 0090: 18 00 23 00 00 00 16 00 00 00 17 00 00 00 0d 00 ..#.............
: 1463 line, 4 level,file message: 00a0: 2a 00 28 04 03 05 03 06 03 08 07 08 08 08 09 08 *.(.............
: 1463 line, 4 level,file message: 00b0: 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 03 ................
: 1463 line, 4 level,file message: 00c0: 03 03 01 03 02 04 02 05 02 06 02 ...........
: 1481 line, 3 level,file message: client hello v3, handshake type: 1
: 1490 line, 3 level,file message: client hello v3, handshake len.: 199
: 1579 line, 3 level,file message: dumping 'client hello, version' (2 bytes)
: 1579 line, 3 level,file message: 0000: 03 03 ..
: 1610 line, 3 level,file message: dumping 'client hello, random bytes' (32 bytes)
: 1610 line, 3 level,file message: 0000: 33 89 ee 0a c8 f4 8d 69 14 00 2d 50 69 44 70 4f 3......i..-PiDpO
: 1610 line, 3 level,file message: 0010: fa 47 8e 73 e5 76 cf 2c 5a 63 8f 78 af 8b 26 0f .G.s.v.,Zc.x..&.
: 1628 line, 3 level,file message: dumping 'client hello, session id' (0 bytes)
: 1713 line, 3 level,file message: dumping 'client hello, ciphersuitelist' (56 bytes)
: 1713 line, 3 level,file message: 0000: c0 2c c0 30 00 9f cc a9 cc a8 cc aa c0 2b c0 2f .,.0.........+./
: 1713 line, 3 level,file message: 0010: 00 9e c0 24 c0 28 00 6b c0 23 c0 27 00 67 c0 0a ...$.(.k.#.'.g..
: 1713 line, 3 level,file message: 0020: c0 14 00 39 c0 09 c0 13 00 33 00 9d 00 9c 00 3d ...9.....3.....=
: 1713 line, 3 level,file message: 0030: 00 3c 00 35 00 2f 00 ff .<.5./..
: 1733 line, 3 level,file message: dumping 'client hello, compression' (1 bytes)
: 1733 line, 3 level,file message: 0000: 00 .
: 1788 line, 3 level,file message: dumping 'client hello extensions' (102 bytes)
: 1788 line, 3 level,file message: 0000: 00 00 00 10 00 0e 00 00 0b 65 78 61 6d 70 6c 65 .........example
: 1788 line, 3 level,file message: 0010: 2e 6f 72 67 00 0b 00 04 03 00 01 02 00 0a 00 0c .org............
: 1788 line, 3 level,file message: 0020: 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 23 00 00 .............#..
: 1788 line, 3 level,file message: 0030: 00 16 00 00 00 17 00 00 00 0d 00 2a 00 28 04 03 ...........*.(..
: 1788 line, 3 level,file message: 0040: 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 ................
: 1788 line, 3 level,file message: 0050: 08 05 08 06 04 01 05 01 06 01 03 03 03 01 03 02 ................
: 1788 line, 3 level,file message: 0060: 04 02 05 02 06 02 ......
: 1814 line, 3 level,file message: found ServerName extension
: 1860 line, 3 level,file message: found supported point formats extension
: 418 line, 4 level,file message: point format selected: 0
: 1852 line, 3 level,file message: found supported elliptic curves extension
: 1932 line, 3 level,file message: found session ticket extension
: 1912 line, 3 level,file message: found encrypt then mac extension
: 1922 line, 3 level,file message: found extended master secret extension
: 1838 line, 3 level,file message: found signature_algorithms extension
: 308 line, 3 level,file message: client hello v3, signature_algorithm ext: match sig 4 and hash 6
: 308 line, 3 level,file message: client hello v3, signature_algorithm ext: match sig 4 and hash 7
: 308 line, 3 level,file message: client hello v3, signature_algorithm ext: match sig 4 and hash 8
: 290 line, 3 level,file message: client hello v3, signature_algorithm ext unknown sig alg encoding 7
: 290 line, 3 level,file message: client hello v3, signature_algorithm ext unknown sig alg encoding 8
: 290 line, 3 level,file message: client hello v3, signature_algorithm ext unknown sig alg encoding 9
: 290 line, 3 level,file message: client hello v3, signature_algorithm ext unknown sig alg encoding 10
: 290 line, 3 level,file message: client hello v3, signature_algorithm ext unknown sig alg encoding 11
: 290 line, 3 level,file message: client hello v3, signature_algorithm ext unknown sig alg encoding 4
: 290 line, 3 level,file message: client hello v3, signature_algorithm ext unknown sig alg encoding 5
: 290 line, 3 level,file message: client hello v3, signature_algorithm ext unknown sig alg encoding 6
: 308 line, 3 level,file message: client hello v3, signature_algorithm ext: match sig 1 and hash 6
: 308 line, 3 level,file message: client hello v3, signature_algorithm ext: match sig 1 and hash 7
: 308 line, 3 level,file message: client hello v3, signature_algorithm ext: match sig 1 and hash 8
: 308 line, 3 level,file message: client hello v3, signature_algorithm ext: match sig 4 and hash 5
: 308 line, 3 level,file message: client hello v3, signature_algorithm ext: match sig 1 and hash 5
: 290 line, 3 level,file message: client hello v3, signature_algorithm ext unknown sig alg encoding 2
: 290 line, 3 level,file message: client hello v3, signature_algorithm ext unknown sig alg encoding 2
: 290 line, 3 level,file message: client hello v3, signature_algorithm ext unknown sig alg encoding 2
: 290 line, 3 level,file message: client hello v3, signature_algorithm ext unknown sig alg encoding 2
: 2020 line, 3 level,file message: received TLS_EMPTY_RENEGOTIATION_INFO
: 936 line, 3 level,file message: trying ciphersuite: TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256
: 833 line, 3 level,file message: ciphersuite requires certificate
: 845 line, 3 level,file message: candidate certificate chain, certificate #1:
: 845 line, 3 level,file message: cert. version : 3
: 845 line, 3 level,file message: serial number : 53:75:36:13:4F:C6:31:4A
: 845 line, 3 level,file message: issuer name : CN=Straight RootCA
: 845 line, 3 level,file message: subject name : CN=Straight Server
: 845 line, 3 level,file message: issued on : 2020-11-15 00:00:00
: 845 line, 3 level,file message: expires on : 2040-11-15 00:00:00
: 845 line, 3 level,file message: signed using : RSA with SHA-256
: 845 line, 3 level,file message: RSA key size : 512 bits
: 845 line, 3 level,file message: basic constraints : CA=false
: 845 line, 3 level,file message: subject alt name :
: 845 line, 3 level,file message: dNSName : server
: 845 line, 3 level,file message: dNSName : straight
: 845 line, 3 level,file message: ext key usage : TLS Web Server Authentication
: 845 line, 3 level,file message: value of 'crt->rsa.N' (512 bits) is:
: 845 line, 3 level,file message: 84 3d 05 28 d7 47 f7 57 3c 56 2b 34 4f b3 e5 8b
: 845 line, 3 level,file message: 71 ab 6f e0 4c e7 10 35 57 f8 8d 4c 67 ab e5 64
: 845 line, 3 level,file message: b0 26 50 1a 6f a9 49 e8 d3 61 ed 1d 79 01 73 8e
: 845 line, 3 level,file message: ed 73 83 3a ce 7c 8a 49 84 aa 05 a2 c1 a7 10 7f
: 845 line, 3 level,file message: value of 'crt->rsa.E' (17 bits) is:
: 845 line, 3 level,file message: 01 00 01
: 907 line, 3 level,file message: selected certificate chain, certificate #1:
: 907 line, 3 level,file message: cert. version : 3
: 907 line, 3 level,file message: serial number : 53:75:36:13:4F:C6:31:4A
: 907 line, 3 level,file message: issuer name : CN=Straight RootCA
: 907 line, 3 level,file message: subject name : CN=Straight Server
: 907 line, 3 level,file message: issued on : 2020-11-15 00:00:00
: 907 line, 3 level,file message: expires on : 2040-11-15 00:00:00
: 907 line, 3 level,file message: signed using : RSA with SHA-256
: 907 line, 3 level,file message: RSA key size : 512 bits
: 907 line, 3 level,file message: basic constraints : CA=false
: 907 line, 3 level,file message: subject alt name :
: 907 line, 3 level,file message: dNSName : server
: 907 line, 3 level,file message: dNSName : straight
: 907 line, 3 level,file message: ext key usage : TLS Web Server Authentication
: 907 line, 3 level,file message: value of 'crt->rsa.N' (512 bits) is:
: 907 line, 3 level,file message: 84 3d 05 28 d7 47 f7 57 3c 56 2b 34 4f b3 e5 8b
: 907 line, 3 level,file message: 71 ab 6f e0 4c e7 10 35 57 f8 8d 4c 67 ab e5 64
: 907 line, 3 level,file message: b0 26 50 1a 6f a9 49 e8 d3 61 ed 1d 79 01 73 8e
: 907 line, 3 level,file message: ed 73 83 3a ce 7c 8a 49 84 aa 05 a2 c1 a7 10 7f
: 907 line, 3 level,file message: value of 'crt->rsa.E' (17 bits) is:
: 907 line, 3 level,file message: 01 00 01
: 2123 line, 2 level,file message: selected ciphersuite: TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256
: 2147 line, 3 level,file message: client hello v3, signature_algorithm ext: 4
: 2157 line, 2 level,file message: <= parse client hello
: 4458 line, 2 level,file message: server state: 2
: 2080 line, 2 level,file t message: => flush output
: 2092 line, 2 level,file t message: <= flush output
: 2589 line, 2 level,file message: => write server hello
: 2623 line, 3 level,file message: server hello, chosen version: [3:3]
: 2647 line, 3 level,file message: dumping 'server hello, random bytes' (32 bytes)
: 2647 line, 3 level,file message: 0000: 3c ce d6 f9 48 cc 7d 5d 77 24 74 f2 1d 9f 8b aa <...H.}]w$t.....
: 2647 line, 3 level,file message: 0010: 4b 0c 20 64 d3 22 d0 ee 5e 3b 83 24 a7 01 ec d9 K. d."..^;.$....
: 2720 line, 3 level,file message: server hello, session id len.: 32
: 2721 line, 3 level,file message: dumping 'server hello, session id' (32 bytes)
: 2721 line, 3 level,file message: 0000: 39 44 75 59 8d 9f fd 10 16 21 18 ca e7 46 9e 5f 9DuY.....!...F._
: 2721 line, 3 level,file message: 0010: d0 72 aa 02 d9 51 e0 57 04 8d c6 dd f2 24 dd 39 .r...Q.W.....$.9
: 2723 line, 3 level,file message: no session has been resumed
: 2730 line, 3 level,file message: server hello, chosen ciphersuite: TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256
: 2732 line, 3 level,file message: server hello, compress alg.: 0x00
: 2342 line, 3 level,file message: server hello, secure renegotiation extension
: 2293 line, 3 level,file message: server hello, adding extended master secret extension
: 2413 line, 3 level,file message: server hello, supported_point_formats extension
: 2796 line, 3 level,file message: server hello, total extension length: 15
: 2516 line, 2 level,file t message: => write handshake message
: 2675 line, 2 level,file t message: => write record
: 2793 line, 3 level,file t message: output record: msgtype = 22, version = [3:3], msglen = 91
: 2796 line, 4 level,file t message: dumping 'output record sent to network' (96 bytes)
: 2796 line, 4 level,file t message: 0000: 16 03 03 00 5b 02 00 00 57 03 03 3c ce d6 f9 48 ....[...W..<...H
: 2796 line, 4 level,file t message: 0010: cc 7d 5d 77 24 74 f2 1d 9f 8b aa 4b 0c 20 64 d3 .}]w$t.....K. d.
: 2796 line, 4 level,file t message: 0020: 22 d0 ee 5e 3b 83 24 a7 01 ec d9 20 39 44 75 59 "..^;.$.... 9DuY
: 2796 line, 4 level,file t message: 0030: 8d 9f fd 10 16 21 18 ca e7 46 9e 5f d0 72 aa 02 .....!...F._.r..
: 2796 line, 4 level,file t message: 0040: d9 51 e0 57 04 8d c6 dd f2 24 dd 39 cc a8 00 00 .Q.W.....$.9....
: 2796 line, 4 level,file t message: 0050: 0f ff 01 00 01 00 00 17 00 00 00 0b 00 02 01 00 ................
: 2080 line, 2 level,file t message: => flush output
: 2099 line, 2 level,file t message: message length: 96, out_left: 96
: 2104 line, 2 level,file t message: ssl->f_send() returned 96 (-0xffffffa0)
: 2132 line, 2 level,file t message: <= flush output
: 2846 line, 2 level,file t message: <= write record
: 2652 line, 2 level,file t message: <= write handshake message
: 2815 line, 2 level,file message: <= write server hello
: 4458 line, 2 level,file message: server state: 3
: 2080 line, 2 level,file t message: => flush output
: 2092 line, 2 level,file t message: <= flush output
: 2093 line, 2 level,file message: => write certificate
: 2142 line, 3 level,file message: own certificate #1:
: 2142 line, 3 level,file message: cert. version : 3
: 2142 line, 3 level,file message: serial number : 53:75:36:13:4F:C6:31:4A
: 2142 line, 3 level,file message: issuer name : CN=Straight RootCA
: 2142 line, 3 level,file message: subject name : CN=Straight Server
: 2142 line, 3 level,file message: issued on : 2020-11-15 00:00:00
: 2142 line, 3 level,file message: expires on : 2040-11-15 00:00:00
: 2142 line, 3 level,file message: signed using : RSA with SHA-256
: 2142 line, 3 level,file message: RSA key size : 512 bits
: 2142 line, 3 level,file message: basic constraints : CA=false
: 2142 line, 3 level,file message: subject alt name :
: 2142 line, 3 level,file message: dNSName : server
: 2142 line, 3 level,file message: dNSName : straight
: 2142 line, 3 level,file message: ext key usage : TLS Web Server Authentication
: 2142 line, 3 level,file message: value of 'crt->rsa.N' (512 bits) is:
: 2142 line, 3 level,file message: 84 3d 05 28 d7 47 f7 57 3c 56 2b 34 4f b3 e5 8b
: 2142 line, 3 level,file message: 71 ab 6f e0 4c e7 10 35 57 f8 8d 4c 67 ab e5 64
: 2142 line, 3 level,file message: b0 26 50 1a 6f a9 49 e8 d3 61 ed 1d 79 01 73 8e
: 2142 line, 3 level,file message: ed 73 83 3a ce 7c 8a 49 84 aa 05 a2 c1 a7 10 7f
: 2142 line, 3 level,file message: value of 'crt->rsa.E' (17 bits) is:
: 2142 line, 3 level,file message: 01 00 01
: 2516 line, 2 level,file t message: => write handshake message
: 2675 line, 2 level,file t message: => write record
: 2793 line, 3 level,file t message: output record: msgtype = 22, version = [3:3], msglen = 488
: 2796 line, 4 level,file t message: dumping 'output record sent to network' (493 bytes)
: 2796 line, 4 level,file t message: 0000: 16 03 03 01 e8 0b 00 01 e4 00 01 e1 00 01 de 30 ...............0
: 2796 line, 4 level,file t message: 0010: 82 01 da 30 82 01 84 a0 03 02 01 02 02 08 53 75 ...0..........Su
: 2796 line, 4 level,file t message: 0020: 36 13 4f c6 31 4a 30 0d 06 09 2a 86 48 86 f7 0d 6.O.1J0...*.H...
: 2796 line, 4 level,file t message: 0030: 01 01 0b 05 00 30 1a 31 18 30 16 06 03 55 04 03 .....0.1.0...U..
: 2796 line, 4 level,file t message: 0040: 0c 0f 53 74 72 61 69 67 68 74 20 52 6f 6f 74 43 ..Straight RootC
: 2796 line, 4 level,file t message: 0050: 41 30 1e 17 0d 32 30 31 31 31 35 30 30 30 30 30 A0...20111500000
: 2796 line, 4 level,file t message: 0060: 30 5a 17 0d 34 30 31 31 31 35 30 30 30 30 30 30 0Z..401115000000
: 2796 line, 4 level,file t message: 0070: 5a 30 1a 31 18 30 16 06 03 55 04 03 0c 0f 53 74 Z0.1.0...U....St
: 2796 line, 4 level,file t message: 0080: 72 61 69 67 68 74 20 53 65 72 76 65 72 30 5c 30 raight Server0\0
: 2796 line, 4 level,file t message: 0090: 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 4b ...*.H.........K
: 2796 line, 4 level,file t message: 00a0: 00 30 48 02 41 00 84 3d 05 28 d7 47 f7 57 3c 56 .0H.A..=.(.G.W<V
: 2796 line, 4 level,file t message: 00b0: 2b 34 4f b3 e5 8b 71 ab 6f e0 4c e7 10 35 57 f8 +4O...q.o.L..5W.
: 2796 line, 4 level,file t message: 00c0: 8d 4c 67 ab e5 64 b0 26 50 1a 6f a9 49 e8 d3 61 .Lg..d.&P.o.I..a
: 2796 line, 4 level,file t message: 00d0: ed 1d 79 01 73 8e ed 73 83 3a ce 7c 8a 49 84 aa ..y.s..s.:.|.I..
: 2796 line, 4 level,file t message: 00e0: 05 a2 c1 a7 10 7f 02 03 01 00 01 a3 81 ad 30 81 ..............0.
: 2796 line, 4 level,file t message: 00f0: aa 30 49 06 03 55 1d 23 04 42 30 40 80 14 83 84 .0I..U.#.B0#....
: 2796 line, 4 level,file t message: 0100: e2 b3 b3 ed cc a3 9e 8e 7a 58 8e 30 cd 20 41 98 ........zX.0. A.
: 2796 line, 4 level,file t message: 0110: 1a 7c a1 1e a4 1c 30 1a 31 18 30 16 06 03 55 04 .|....0.1.0...U.
: 2796 line, 4 level,file t message: 0120: 03 0c 0f 53 74 72 61 69 67 68 74 20 52 6f 6f 74 ...Straight Root
: 2796 line, 4 level,file t message: 0130: 43 41 82 08 67 12 d4 80 49 b6 74 1c 30 1d 06 03 CA..g...I.t.0...
: 2796 line, 4 level,file t message: 0140: 55 1d 0e 04 16 04 14 1a ba 0a 36 d4 53 5d 0e e7 U.........6.S]..
: 2796 line, 4 level,file t message: 0150: c5 e6 12 42 56 6a df 9a 15 40 34 30 0c 06 03 55 ...BVj...#40...U
: 2796 line, 4 level,file t message: 0160: 1d 13 01 01 ff 04 02 30 00 30 13 06 03 55 1d 25 .......0.0...U.%
: 2796 line, 4 level,file t message: 0170: 04 0c 30 0a 06 08 2b 06 01 05 05 07 03 01 30 1b ..0...+.......0.
: 2796 line, 4 level,file t message: 0180: 06 03 55 1d 11 04 14 30 12 82 06 73 65 72 76 65 ..U....0...serve
: 2796 line, 4 level,file t message: 0190: 72 82 08 73 74 72 61 69 67 68 74 30 0d 06 09 2a r..straight0...*
: 2796 line, 4 level,file t message: 01a0: 86 48 86 f7 0d 01 01 0b 05 00 03 41 00 3b 4d a3 .H.........A.;M.
: 2796 line, 4 level,file t message: 01b0: 27 0c 68 91 1e 02 78 0f 03 0c 9a a9 ff d4 24 d1 '.h...x.......$.
: 2796 line, 4 level,file t message: 01c0: d8 a6 ff ff 9c 8d 54 e3 c6 a2 20 51 2e 72 90 d5 ......T... Q.r..
: 2796 line, 4 level,file t message: 01d0: b6 08 02 11 b8 fe 6b 57 2c cd bf a5 34 d8 5d 2a ......kW,...4.]*
: 2796 line, 4 level,file t message: 01e0: f7 65 6c ff be 78 fd ea 7e 4f 24 fb d3 .el..x..~O$..
: 2080 line, 2 level,file t message: => flush output
: 2099 line, 2 level,file t message: message length: 493, out_left: 493
: 2104 line, 2 level,file t message: ssl->f_send() returned 493 (-0xfffffe13)
: 2132 line, 2 level,file t message: <= flush output
: 2846 line, 2 level,file t message: <= write record
: 2652 line, 2 level,file t message: <= write handshake message
: 2194 line, 2 level,file message: <= write certificate
: 4458 line, 2 level,file message: server state: 4
: 2080 line, 2 level,file t message: => flush output
: 2092 line, 2 level,file t message: <= flush output
: 3436 line, 2 level,file message: => write server key exchange
: 3214 line, 2 level,file message: ECDHE curve: secp521r1
: 3240 line, 3 level,file message: value of 'ECDH: Q(X)' (521 bits) is:
: 3240 line, 3 level,file message: 01 a4 3d 1f 0a f9 85 dc 1c 6b 55 b2 33 de 60 1b
: 3240 line, 3 level,file message: c6 13 3c ee b9 c9 07 7f 63 fe b4 e6 65 43 36 08
: 3240 line, 3 level,file message: cd 48 0e ab 39 88 0d 65 5d 93 79 d3 e9 3c 34 c5
: 3240 line, 3 level,file message: b7 94 fc f1 e2 eb 16 64 37 65 98 ca 9a 4f 95 d1
: 3240 line, 3 level,file message: 05 75
: 3240 line, 3 level,file message: value of 'ECDH: Q(Y)' (518 bits) is:
: 3240 line, 3 level,file message: 31 6b 86 3a b2 34 b4 f6 4c 40 b5 d3 af fe f2 2d
: 3240 line, 3 level,file message: 7d a2 57 d9 79 ad 76 2e d1 14 14 88 22 5b 00 d1
: 3240 line, 3 level,file message: a8 bf 1b 44 d5 46 95 59 df 5c d0 00 02 90 7e c4
: 3240 line, 3 level,file message: b3 61 72 db 6b 33 81 a9 87 07 9b 3f 8d e8 36 34
: 3240 line, 3 level,file message: 48
: 3303 line, 3 level,file message: pick hash algorithm 6 for signing
: 7538 line, 3 level,file message: Perform mbedtls-based computation of digest of ServerKeyExchange
: 3341 line, 3 level,file message: dumping 'parameters hash' (32 bytes)
: 3341 line, 3 level,file message: 0000: ef 45 58 c8 60 14 a2 ca 26 31 c3 f0 f3 a0 c2 e0 .EX.`...&1......
: 3341 line, 3 level,file message: 0010: 79 6b 30 1d 91 16 76 f9 df 6b 96 1e d9 06 15 31 yk0...v..k.....1
: 3501 line, 3 level,file message: dumping 'my signature' (64 bytes)
: 3501 line, 3 level,file message: 0000: 09 5c bb 24 ed be ed 5a ac 29 42 14 69 10 3b db .\.$...Z.)B.i.;.
: 3501 line, 3 level,file message: 0010: b1 d2 d9 c1 84 3e f1 bd 5d b2 f4 9a b2 5b 13 be .....>..]....[..
: 3501 line, 3 level,file message: 0020: fd ee 55 44 93 10 81 6c 4c 2c cb cb 86 e6 a9 a3 ..UD...lL,......
: 3501 line, 3 level,file message: 0030: b3 1c b1 69 02 1c cc 32 0e 7e b7 fc 13 61 16 93 ...i...2.~...a..
: 2516 line, 2 level,file t message: => write handshake message
: 2675 line, 2 level,file t message: => write record
: 2793 line, 3 level,file t message: output record: msgtype = 22, version = [3:3], msglen = 209
: 2796 line, 4 level,file t message: dumping 'output record sent to network' (214 bytes)
: 2796 line, 4 level,file t message: 0000: 16 03 03 00 d1 0c 00 00 cd 03 00 19 85 04 01 a4 ................
: 2796 line, 4 level,file t message: 0010: 3d 1f 0a f9 85 dc 1c 6b 55 b2 33 de 60 1b c6 13 =......kU.3.`...
: 2796 line, 4 level,file t message: 0020: 3c ee b9 c9 07 7f 63 fe b4 e6 65 43 36 08 cd 48 <.....c...eC6..H
: 2796 line, 4 level,file t message: 0030: 0e ab 39 88 0d 65 5d 93 79 d3 e9 3c 34 c5 b7 94 ..9..e].y..<4...
: 2796 line, 4 level,file t message: 0040: fc f1 e2 eb 16 64 37 65 98 ca 9a 4f 95 d1 05 75 .....d7e...O...u
: 2796 line, 4 level,file t message: 0050: 00 31 6b 86 3a b2 34 b4 f6 4c 40 b5 d3 af fe f2 .1k.:.4..L#.....
: 2796 line, 4 level,file t message: 0060: 2d 7d a2 57 d9 79 ad 76 2e d1 14 14 88 22 5b 00 -}.W.y.v....."[.
: 2796 line, 4 level,file t message: 0070: d1 a8 bf 1b 44 d5 46 95 59 df 5c d0 00 02 90 7e ....D.F.Y.\....~
: 2796 line, 4 level,file t message: 0080: c4 b3 61 72 db 6b 33 81 a9 87 07 9b 3f 8d e8 36 ..ar.k3.....?..6
: 2796 line, 4 level,file t message: 0090: 34 48 04 01 00 40 09 5c bb 24 ed be ed 5a ac 29 4H...#.\.$...Z.)
: 2796 line, 4 level,file t message: 00a0: 42 14 69 10 3b db b1 d2 d9 c1 84 3e f1 bd 5d b2 B.i.;......>..].
: 2796 line, 4 level,file t message: 00b0: f4 9a b2 5b 13 be fd ee 55 44 93 10 81 6c 4c 2c ...[....UD...lL,
: 2796 line, 4 level,file t message: 00c0: cb cb 86 e6 a9 a3 b3 1c b1 69 02 1c cc 32 0e 7e .........i...2.~
: 2796 line, 4 level,file t message: 00d0: b7 fc 13 61 16 93 ...a..
: 2080 line, 2 level,file t message: => flush output
: 2099 line, 2 level,file t message: message length: 214, out_left: 214
: 2104 line, 2 level,file t message: ssl->f_send() returned 214 (-0xffffff2a)
: 2132 line, 2 level,file t message: <= flush output
: 2846 line, 2 level,file t message: <= write record
: 2652 line, 2 level,file t message: <= write handshake message
: 3520 line, 2 level,file message: <= write server key exchange
: 4458 line, 2 level,file message: server state: 5
: 2080 line, 2 level,file t message: => flush output
: 2092 line, 2 level,file t message: <= flush output
: 2851 line, 2 level,file message: => write certificate request
: 2516 line, 2 level,file t message: => write handshake message
: 2675 line, 2 level,file t message: => write record
: 2793 line, 3 level,file t message: output record: msgtype = 22, version = [3:3], msglen = 23
: 2796 line, 4 level,file t message: dumping 'output record sent to network' (28 bytes)
: 2796 line, 4 level,file t message: 0000: 16 03 03 00 17 0d 00 00 13 02 01 40 00 0c 05 01 ...........#....
: 2796 line, 4 level,file t message: 0010: 05 03 04 01 04 03 02 01 02 03 00 00 ............
: 2080 line, 2 level,file t message: => flush output
: 2099 line, 2 level,file t message: message length: 28, out_left: 28
: 2104 line, 2 level,file t message: ssl->f_send() returned 28 (-0xffffffe4)
: 2132 line, 2 level,file t message: <= flush output
: 2846 line, 2 level,file t message: <= write record
: 2652 line, 2 level,file t message: <= write handshake message
: 3002 line, 2 level,file message: <= write certificate request
: 4458 line, 2 level,file message: server state: 6
: 2080 line, 2 level,file t message: => flush output
: 2092 line, 2 level,file t message: <= flush output
: 3528 line, 2 level,file message: => write server hello done
: 2516 line, 2 level,file t message: => write handshake message
: 2675 line, 2 level,file t message: => write record
: 2793 line, 3 level,file t message: output record: msgtype = 22, version = [3:3], msglen = 4
: 2796 line, 4 level,file t message: dumping 'output record sent to network' (9 bytes)
: 2796 line, 4 level,file t message: 0000: 16 03 03 00 04 0e 00 00 00 .........
: 2080 line, 2 level,file t message: => flush output
: 2099 line, 2 level,file t message: message length: 9, out_left: 9
: 2104 line, 2 level,file t message: ssl->f_send() returned 9 (-0xfffffff7)
: 2132 line, 2 level,file t message: <= flush output
: 2846 line, 2 level,file t message: <= write record
: 2652 line, 2 level,file t message: <= write handshake message
: 3556 line, 2 level,file message: <= write server hello done
: 4458 line, 2 level,file message: server state: 7
: 2080 line, 2 level,file t message: => flush output
: 2092 line, 2 level,file t message: <= flush output
: 2731 line, 2 level,file message: => parse certificate
: 3878 line, 2 level,file t message: => read record
: 1860 line, 2 level,file t message: => fetch input
: 2022 line, 2 level,file t message: in_left: 0, nb_want: 5
: 2046 line, 2 level,file t message: in_left: 0, nb_want: 5
: 5707 line, 2 level,file message: <= handshake
Related
Detect tcp protocol, or fresh idea to reverse it
im trying to reverse one app, and wanted to ask, maybe some one can help with fresh idea, or already know what is used here. So the case, i have client and server, now i have written mitm app, and i can see the packets. Tha packets order is s2c: sending rsa key c2s: sending some always static data, encrypted with rsa s2c: sending some response, seems like an packet without body (im here) c2s: sending data, and here is problem, that this packet is not encrypted as packet 2 c2s: sending response this is packet header 50 50 00 00 40 00 50 00 00 00 00 00 ... rest is body lets divide it 50 50 - this is always same 00 00 - this is some packet flag, cause always after packet 3, it becomes x04 00 40 00 - this is length 100% 50 00 - packet code i think 00 00 00 00 - i dont know what i this body - is not readable, but also is not encrypted with rsa here is example of stream **s2c packet 1** 2023/01/24 21:32:56 Received: 176 00000000 *50 50 00 00 a4 00 01 00 00 00 00 00* a2 00 2d 2d |PP............--| 00000010 2d 2d 2d 42 45 47 49 4e 20 52 53 41 20 50 55 42 |---BEGIN RSA PUB| 00000020 4c 49 43 20 4b 45 59 2d 2d 2d 2d 2d 0a 4d 45 63 |LIC KEY-----.MEc| 00000030 43 51 51 43 71 49 4e 36 37 76 45 52 47 37 34 49 |CQQCqIN67vERG74I| 00000040 64 77 38 6d 76 6c 66 6d 45 31 38 31 31 56 74 2b |dw8mvlfmE1811Vt+| 00000050 53 76 66 67 73 36 43 68 59 51 78 4e 5a 52 57 74 |Svfgs6ChYQxNZRWt| 00000060 7a 31 6f 62 50 53 69 34 62 75 78 72 41 0a 5a 6d |z1obPSi4buxrA.Zm| 00000070 6d 77 32 4e 69 38 44 59 74 67 6d 77 54 74 48 51 |mw2Ni8DYtgmwTtHQ| 00000080 66 6b 6d 35 65 59 2f 76 63 54 41 67 49 44 43 51 |fkm5eY/vcTAgIDCQ| 00000090 3d 3d 0a 2d 2d 2d 2d 2d 45 4e 44 20 52 53 41 20 |==.-----END RSA | 000000a0 50 55 42 4c 49 43 20 4b 45 59 2d 2d 2d 2d 2d 0a |PUBLIC KEY-----.| 2023/01/24 21:32:56 RSA Key chaged - here i changed key to my **c2s packet 2** 2023/01/24 21:32:56 Received: 76 00000000 *50 50 00 00 40 00 50 00 00 00 00 00* 97 4a 85 34 |PP..#.P......J.4| 00000010 e6 e0 f8 56 d6 5b 12 a4 4b 3f e2 f3 c7 b4 a1 fc |...V.[..K?......| 00000020 c7 fe b8 88 bc b7 8b 93 89 c2 7f 02 09 7b 52 4a |.............{RJ| 00000030 23 be a4 47 eb b8 02 f5 0a 62 9a 88 15 13 12 de |#..G.....b......| 00000040 a4 94 2c 3a 0a 34 47 bb 13 6f d4 ae |..,:.4G..o..| 2023/01/24 21:32:56 Header: 76 00000000 *50 50 00 00 40 00 50 00 00 00 00 00* |PP..#.P.....| 2023/01/24 21:32:56 Encoded with my key 00000000 *97 4a 85 34 e6 e0 f8 56 d6 5b 12 a4* 4b 3f e2 f3 |.J.4...V.[..K?..| 00000010 c7 b4 a1 fc c7 fe b8 88 bc b7 8b 93 89 c2 7f 02 |................| 00000020 09 7b 52 4a 23 be a4 47 eb b8 02 f5 0a 62 9a 88 |.{RJ#..G.....b..| 00000030 15 13 12 de a4 94 2c 3a 0a 34 47 bb 13 6f d4 ae |......,:.4G..o..| 2023/01/24 21:32:56 Decoded body 00000000 29 00 00 00 23 48 00 00 be 18 00 00 84 67 00 00 |)...#H.......g..| 2023/01/24 21:32:56 Encoded with original key 00000000 0a cb d2 7f f6 a3 8b 57 2c 6b e8 6d ed f0 c1 36 |.......W,k.m...6| 00000010 e4 c8 00 9d ca 55 41 62 ef 4b 72 91 7c fc 7b 1d |.....UAb.Kr.|.{.| 00000020 e4 5c f0 2b ce 86 01 79 ae b8 13 dd 51 a0 30 c5 |.\.+...y....Q.0.| 00000030 6f 77 fa 11 ed 03 7b 2c 77 7c 5b 7e 61 6f 86 9d |ow....{,w|[~ao..| **s2c packet 3** 2023/01/24 21:32:56 Received: 12 00000000 *50 50 00 00 00 00 02 00 00 00 00 00* |PP..........| **c2s packet 4** 2023/01/24 21:32:56 Not decoding next packet 2023/01/24 21:32:56 Received: 174 00000000 *50 50 04 00 a2 00 01 30 00 00 00 00* 00 9f 53 ab |PP.....0......S.| 00000010 c8 58 49 ea 4d fa 18 f4 f1 fc 9a 3c 04 ca 11 94 |.XI.M......<....| 00000020 ab ec ba 1d c6 f0 5d e0 1f d6 87 2d de 0c 97 eb |......]....-....| 00000030 29 b7 d1 dc 48 38 f4 63 74 29 e2 ea 9f 81 a8 59 |)...H8.ct).....Y| 00000040 47 75 32 0d 53 0e 55 3e cd 7b 89 d9 c3 22 d5 39 |Gu2.S.U>.{...".9| 00000050 c4 18 a5 c7 e2 eb 3a 9e 72 13 36 c3 52 f5 e6 7d |......:.r.6.R..}| 00000060 9b bf 37 06 e5 e9 4c 74 ac 85 37 85 94 81 37 67 |..7...Lt..7...7g| 00000070 f9 28 60 c7 0a ca 4c 5a 57 20 d6 ce 7c 91 58 6b |.(`...LZW ..|.Xk| 00000080 56 af 96 a8 e4 b5 8c 19 2e 9a 8c fa a6 c2 08 24 |V..............$| 00000090 ab 97 5d be 74 c2 19 d2 bd f1 93 5f a5 65 c5 7c |..].t......_.e.|| 000000a0 fa bb 46 07 80 fd b6 79 5c 19 6f 65 54 35 |..F....y\.oeT5| **s2c packet 5** 2023/01/24 21:32:56 Received: 174 00000000 *50 50 04 00 a2 00 01 40 00 00 00 00* 00 9e e7 03 |PP.....#........| 00000010 1b aa 67 36 1e 6f 34 20 c3 7c a9 85 93 74 b7 53 |..g6.o4 .|...t.S| 00000020 cc 10 68 90 ec 41 54 68 bb 9e 3d 41 c9 3f db 41 |..h..ATh..=A.?.A| 00000030 09 b9 ae 6a 9b f9 5c 0f 47 c6 4b bd 94 08 20 b0 |...j..\.G.K... .| 00000040 2e f2 6e 40 11 b6 14 8b e0 51 89 db 0c e0 c8 5b |..n#.....Q.....[| 00000050 92 1f a3 08 90 05 5c b5 bb bb 50 c0 3e f6 ee e8 |......\...P.>...| 00000060 63 bd 23 74 53 24 8f a3 0b 4e 72 12 a0 0e ac 96 |c.#tS$...Nr.....| 00000070 03 2c e8 31 6a 34 10 84 63 7a e1 32 42 d3 69 17 |.,.1j4..cz.2B.i.| 00000080 73 df a4 89 35 90 0f 92 06 d7 3b 2e 3c 3d 6e 7e |s...5.....;.<=n~| 00000090 db 73 cb f0 96 95 df 84 af 20 b7 7b 7c 64 61 a9 |.s....... .{|da.| 000000a0 b2 0e 9d 1e bc 57 73 5f f0 bc a5 aa b8 36 |.....Ws_.....6| Maybe some one can identify protocol by packet header, cause i havent seen something similar before. Thank you i know that only packet 2 is encrypted, cause i changed rsa key to my key, and decoded data, its not work with other packets.
TLS version on Http trace
I'm trying to understang which TLS version is used based on this logs (http trace) System.Net Information: 0 : [2544] SecureChannel#49129953::.AcquireClientCredentials, new SecureCredential() (flags=(ValidateManual, NoDefaultCred, SendAuxRecord), m_ProtocolFlags=(Ssl3Client, Tls10Client), m_EncryptionPolicy=RequireEncryption) Algorithm: RSA Length: 2048 Key Blob: 30 82 01 0a 02 82 01 01 00 b8 de 6a 2c a0 05 1d c1 2e 54 2d de 74 40 a6 83 2b 81 25 29 8d c1 2b e1 4d 4b 63 bd 7f c0 75 fe 15 eb 6b a6 2f 3c 65 d6 7a 55 dc 68 07 1c 6c 2e 8c cd d5 01 74 9f ca ca bb 5e b0 6d 9a 44 d1 1c 74 11 ca 4f 44 fa 59 59 22 f5 f9 c2 00 21 d6 1d a3 09 5a 0e fe da b7 ea d2 c8 55 51 c7 53 90 d1 b9 bf 2c 98 49 75 82 30 .... System.Net Information: 0 : [2544] SecureChannel#49129953 - Remote certificate was verified as valid by the user. System.Net Information: 0 : [2544] ProcessAuthentication(Protocol=Tls, Cipher=Aes128 128 bit strength, Hash=Sha1 160 bit strength, Key Exchange=RsaKeyX 2048 bit strength). Any idea? If you need more log let me know. Thank you
... m_ProtocolFlags=(Ssl3Client, Tls10Client) ... ProcessAuthentication(Protocol=Tls Based on this it should be TLS 1.0. For other versions like TLS 1.2 there is probably something like Protocol=Tls12 instead
What is the pattern?
I have a list of keys with some corresponding hex values. The first 3 digits are the key and the rest is the value: Key Value 110 02 30 30 81 56 8B 80 F4 4F 03 111 02 30 30 81 56 8B 81 F5 4F 03 112 02 30 30 81 56 8B 82 F6 4F 03 113 02 30 30 81 56 8B 83 F7 4F 03 114 02 30 30 81 56 8B 84 F8 4F 03 115 02 30 30 81 56 8B 85 F9 4F 03 116 02 30 30 81 56 8B 86 FA 4F 03 117 02 30 30 81 56 8B 87 FB 4F 03 118 02 30 30 81 56 8B 88 FC 4F 03 119 02 30 30 81 56 8B 89 FD 4F 03 120 02 30 30 81 56 8C 80 F5 4F 03 121 02 30 30 81 56 8C 81 F6 4F 03 122 02 30 30 81 56 8C 82 F7 4F 03 123 02 30 30 81 56 8C 83 F8 4F 03 124 02 30 30 81 56 8C 84 F9 4F 03 125 02 30 30 81 56 8C 85 FA 4F 03 126 02 30 30 81 56 8C 86 FB 4F 03 127 02 30 30 81 56 8C 87 FC 4F 03 128 02 30 30 81 56 8C 88 FD 4F 03 129 02 30 30 81 56 8C 89 FE 4F 03 130 02 30 30 81 56 8D 80 F6 4F 03 131 02 30 30 81 56 8D 81 F7 4F 03 132 02 30 30 81 56 8D 82 F8 4F 03 133 02 30 30 81 56 8D 83 F9 4F 03 134 02 30 30 81 56 8D 84 FA 4F 03 135 02 30 30 81 56 8D 85 FB 4F 03 136 02 30 30 81 56 8D 86 FC 4F 03 137 02 30 30 81 56 8D 87 FD 4F 03 138 02 30 30 81 56 8D 88 FE 4F 03 139 02 30 30 81 56 8D 89 FF 4F 03 140 02 30 30 81 56 8E 80 F7 4F 03 141 02 30 30 81 56 8E 81 F8 4F 03 142 02 30 30 81 56 8E 82 F9 4F 03 143 02 30 30 81 56 8E 83 FA 4F 03 144 02 30 30 81 56 8E 84 FB 4F 03 145 02 30 30 81 56 8E 85 FC 4F 03 146 02 30 30 81 56 8E 86 FD 4F 03 147 02 30 30 81 56 8E 87 FE 4F 03 148 02 30 30 81 56 8E 88 FF 4F 03 149 02 30 30 81 56 8E 89 F0 5F 03 150 02 30 30 81 56 8F 80 F8 4F 03 151 02 30 30 81 56 8F 81 F9 4F 03 152 02 30 30 81 56 8F 82 FA 4F 03 153 02 30 30 81 56 8F 83 FB 4F 03 154 02 30 30 81 56 8F 84 FC 4F 03 155 02 30 30 81 56 8F 85 FD 4F 03 156 02 30 30 81 56 8F 86 FE 4F 03 157 02 30 30 81 56 8F 87 FF 4F 03 158 02 30 30 81 56 8F 88 F0 5F 03 159 02 30 30 81 56 8F 89 F1 5F 03 160 02 30 30 81 56 90 80 F9 4F 03 161 02 30 30 81 56 90 81 FA 4F 03 162 02 30 30 81 56 90 82 FB 4F 03 163 02 30 30 81 56 90 83 FC 4F 03 164 02 30 30 81 56 90 84 FD 4F 03 165 02 30 30 81 56 90 85 FE 4F 03 166 02 30 30 81 56 90 86 FF 4F 03 167 02 30 30 81 56 90 87 F0 5F 03 168 02 30 30 81 56 90 88 F1 5F 03 169 02 30 30 81 56 90 89 F2 5F 03 170 02 30 30 81 56 91 80 FA 4F 03 171 02 30 30 81 56 91 81 FB 4F 03 172 02 30 30 81 56 91 82 FC 4F 03 173 02 30 30 81 56 91 83 FD 4F 03 174 02 30 30 81 56 91 84 FE 4F 03 175 02 30 30 81 56 91 85 FF 4F 03 176 02 30 30 81 56 91 86 F0 5F 03 177 02 30 30 81 56 91 87 F1 5F 03 178 02 30 30 81 56 91 88 F2 5F 03 179 02 30 30 81 56 91 89 F3 5F 03 180 02 30 30 81 56 92 80 FB 4F 03 181 02 30 30 81 56 92 81 FC 4F 03 182 02 30 30 81 56 92 82 FD 4F 03 183 02 30 30 81 56 92 83 FE 4F 03 184 02 30 30 81 56 92 84 FF 4F 03 185 02 30 30 81 56 92 85 F0 5F 03 186 02 30 30 81 56 92 86 F1 5F 03 187 02 30 30 81 56 92 87 F2 5F 03 188 02 30 30 81 56 92 88 F3 5F 03 189 02 30 30 81 56 92 89 F4 5F 03 I can't work out the relationship between the 2 numbers. Bits 11 and 12 seem to relate to the tens in the key and are sequential Bits 13 - 19 seem to be related to the units in the key but are not sequential (not in hex, decimal or binary) The system was created in Spain (not sure if that matters) Is this number sequential? Is there a pattern? i.e. can a program be written to calculate the Nth key's value?
Let data[i, j] represent the value in row i, column j, where i and j are both at least 1: data[i + 1, 1] = data[i, 1] + 1 for all i, data[i, 2] = 02 for all i, data[i, 3] = 30 for all i, data[i, 4] = 81 for all i, data[i, 5] = 56 for all i, data[i, 6] = 8B + ((i - 1) - (i - 1) % A) / A for all i, data[i, 7] = 80 + ((i - 1) % A) for all i, data[i, 8] = F0 + (4 + ((i - 1) - (i - 1) % A) / A + i) % 10 for all i, data[i, 9] = 4F + 10 * ((4 + ((i - 1) - (i - 1) % A) / A + i) - ((4 + ((i - 1) - (i - 1) % A) / A + i) % 10) / 10) for all i, data[i, A] = 03 Note that columns 6 and 7 represent a number equal to 8B7F + i. Also, column 9 represents whether the counter in column 8 has "wrapped around" F and started back at 0. In that sense, the 4 low-order bits of column 9 and column 8 can be taken as a three-digit number whose value is a "rolling window" with increment 1 and period A.
What does this message from syslog#localhost signifies?
Message from syslogd#saskappcu at Mar 18 13:24:54 ... kernel:BUG: soft lockup - CPU#30 stuck for 61s! [events/30:161] Message from syslogd#saskappcu at Mar 18 13:24:54 ... kernel:Process events/30 (pid: 161, ti=f4ea4000 task=f4e5faa0 task.ti=f4ea4000) Message from syslogd#saskappcu at Mar 18 13:24:54 ... kernel:Stack: Message from syslogd#saskappcu at Mar 18 13:24:54 ... kernel:Call Trace: Message from syslogd#saskappcu at Mar 18 13:24:54 ... kernel:Code: 00 89 51 04 89 0a 89 43 20 89 43 24 8b 43 08 39 d8 74 23 83 40 7c 01 31 c9 8b 7b 0c 8b 15 58 09 ac c0 8b 02 39 c2 75 09 eb 31 90 <8b> 00 39 d0 74 2a 3b 78 0c 75 f5 89 d8 ba 00 00 04 00 e8 b9 a0 Message from syslogd#saskappcu at Mar 18 13:24:58 ... kernel:BUG: soft lockup - CPU#8 stuck for 61s! [buildop:2223] Message from syslogd#saskappcu at Mar 18 13:24:58 ... kernel:Process buildop (pid: 2223, ti=e9724000 task=f3ba0aa0 task.ti=e9724000) Message from syslogd#saskappcu at Mar 18 13:24:58 ... kernel:Stack: Message from syslogd#saskappcu at Mar 18 13:24:58 ... kernel:Call Trace: Message from syslogd#saskappcu at Mar 18 13:24:58 ... kernel:Code: 26 00 89 c8 f0 81 28 00 00 00 01 74 05 e8 2c fe ff ff c3 8d b4 26 00 00 00 00 66 ba 00 01 f0 66 0f c1 10 38 f2 74 0e f3 90 8a 10 <eb> f6 66 83 38 00 75 f4 eb e5 c3 8d 74 26 00 f0 81 28 00 00 00
A softlockup is defined as a bug that causes the kernel to loop in kernel mode for more than 20 seconds without giving other tasks a chance to run. The log kernel:BUG: soft lockup - CPU#30 stuck for 61s! [events/30:161] is generated by the following line in kernel/kernel/watchdog.c pr_emerg("BUG: soft lockup - CPU#%d stuck for %us! [%s:%d]\n", smp_processor_id(), duration, current->comm, task_pid_nr(current)); It means that The CPU core 30 in the system, has been busy executing kernel code for the past 61 seconds. The current thread on the system being events/30, whose process-id is 161. For more details, checkout kernel/Documentation/lockup-watchdogs.txt.
PKCS#10 request for a object key pair from PKCS#11
I have a RSA 1024 key pair generated using standard call from PKCS#11. I need to generate a PKCS#10 CSR for the public key. MS has the IEnroll4 dll which will allow to raise a CSR using createRequestWStr. The samples indicate that you need to generate a new key pair(a container with 2 objects in MS CAPI) and MS automatically gives the the public key context for csr generation. In my case, I already have a key pair generated using pkcs#11(as 2 objects but no key container). MS dll is not allowing me to proceed further. QUERY 1: Can some body point out how I can resolve this issue. ---------------------------------------------------------------------------- Alternatively, I was thinking to write my own code for CSR generation based on RSA standards. I am having the ASN 1.0 format The ASN.1 syntax for a Certification Request is: CertificationRequest ::= SEQUENCE { certificationRequestInfo CertificationRequestInfo, signatureAlgorithm SignatureAlgorithmIdentifier, signature Signature } SignatureAlgorithmIdentifier ::= AlgorithmIdentifier Signature ::= BIT STRING CertificationRequestInfo ::= SEQUENCE { version Version, subject Name, subjectPublicKeyInfo SubjectPublicKeyInfo, attributes [0] IMPLICIT Attributes } Attributes ::= SET OF Attribute QUERY 2: How do I use the above syntaxes? I am totally new to this syntax? Which resources should I need to look at to write my own code?
If you need to generate your certificate-request with the PKCS#11-interface (i.e. you cannot use a CSP-interface instead) your best bet is to avoid IEnroll. For C++ your (free and open source) options seems to be to look into OpenSSL or Botan. I am not terribly fond of OpenSSL's API, but it works. I have never used Botan, but it seems pretty nice. There are also many excellent choices if you are willing to pay for them. Alternatively, if you want to write the ASN.1 yourself you probably want to read A Layman's Guide to a Subset of ASN.1, BER, and DER. The formal specifications are in X.208 and X.209, but those are hard reading. You want to generate a DER encoding of the ASN.1 (that is described in the link). Here is an example encoding: 308201493081b3020100300e310c300a06035504031303666f6f30819d300d06092a864886f70d01 0101050003818b00308187028181009c921beeef551bcb051518f0c48bfe72cb1d5609a64a005e0c 008580bb81b3a43cea280d5bffa4e777733845fc2f485f1c8ccc0b2914f30d1e41369fd4a6758a3c c887834c4d6177bd96b9f341232b00d453f28f2ae5ad5e3b0324d0b5b440a0901968fd556470dd4d 2ea2e99dd99c580703c042853265374cd3622f6c3369e5020103300d06092a864886f70d01010505 000381810068c0266a16117b37fb15ad143e2941ff8b8f082daf4ec02789db01636f51c739f199fb 19c56228cc12b9e482b966f8650fa3fdb24e31e97eef15f61aabc91dc194aeba4ebce5eab0c5e3db 36cc090a0e4b2c7d3ac27eeb0d3900d73bd88172464b890a8f9a58a0d34c0f5e226b6173cc92a316 4bbbf1d12f29d1e2ad3f36c977 or translated with the excellent dumpasn1 utility: 0 30 329: SEQUENCE { 4 30 179: SEQUENCE { 7 02 1: INTEGER 0 10 30 14: SEQUENCE { 12 31 12: SET { 14 30 10: SEQUENCE { 16 06 3: OBJECT IDENTIFIER commonName (2 5 4 3) 21 13 3: PrintableString 'foo' : } : } : } 26 30 157: SEQUENCE { 29 30 13: SEQUENCE { 31 06 9: OBJECT IDENTIFIER rsaEncryption (1 2 840 113549 1 1 1) 42 05 0: NULL : } 44 03 139: BIT STRING 0 unused bits, encapsulates { 48 30 135: SEQUENCE { 51 02 129: INTEGER : 00 9C 92 1B EE EF 55 1B CB 05 15 18 F0 C4 8B FE : 72 CB 1D 56 09 A6 4A 00 5E 0C 00 85 80 BB 81 B3 : A4 3C EA 28 0D 5B FF A4 E7 77 73 38 45 FC 2F 48 : 5F 1C 8C CC 0B 29 14 F3 0D 1E 41 36 9F D4 A6 75 : 8A 3C C8 87 83 4C 4D 61 77 BD 96 B9 F3 41 23 2B : 00 D4 53 F2 8F 2A E5 AD 5E 3B 03 24 D0 B5 B4 40 : A0 90 19 68 FD 55 64 70 DD 4D 2E A2 E9 9D D9 9C : 58 07 03 C0 42 85 32 65 37 4C D3 62 2F 6C 33 69 : [ Another 1 bytes skipped ] 183 02 1: INTEGER 3 : } : } : } : } 186 30 13: SEQUENCE { 188 06 9: OBJECT IDENTIFIER : sha1withRSAEncryption (1 2 840 113549 1 1 5) 199 05 0: NULL : } 201 03 129: BIT STRING 0 unused bits : 68 C0 26 6A 16 11 7B 37 FB 15 AD 14 3E 29 41 FF : 8B 8F 08 2D AF 4E C0 27 89 DB 01 63 6F 51 C7 39 : F1 99 FB 19 C5 62 28 CC 12 B9 E4 82 B9 66 F8 65 : 0F A3 FD B2 4E 31 E9 7E EF 15 F6 1A AB C9 1D C1 : 94 AE BA 4E BC E5 EA B0 C5 E3 DB 36 CC 09 0A 0E : 4B 2C 7D 3A C2 7E EB 0D 39 00 D7 3B D8 81 72 46 : 4B 89 0A 8F 9A 58 A0 D3 4C 0F 5E 22 6B 61 73 CC : 92 A3 16 4B BB F1 D1 2F 29 D1 E2 AD 3F 36 C9 77 : }