tempesta-tech / tempesta-test

Test suite for Tempesta FW
10 stars 4 forks source link

Implement test for secp192r1 curve #490

Closed EvgeniiMekhanik closed 11 months ago

EvgeniiMekhanik commented 12 months ago

Implement special test with cert, which signed by supported curve and key with unsupported curve.

const-t commented 11 months ago

Maybe something wrong with my setup, but other tests works fine.

I have following error:

[  110.880742] Start test: tls.test_tls_cert.InvalidKeyWithGoodCert.test
[  110.996096] [tdb] Start Tempesta DB
[  111.016786] [tempesta fw] Initializing Tempesta FW kernel module...
[  111.017532] [tempesta fw]   init: pool
[  111.017955] [tempesta fw]   init: cfg
[  111.018360] [tempesta fw]   init: access_log
[  111.018858] [tempesta fw]   init: apm
[  111.019264] [tempesta fw]   init: vhost
[  111.019714] [tempesta fw]   init: tls
[  111.020206] [tempesta fw]   init: http
[  111.020625] [tempesta fw]   init: http_limits
[  111.021110] [tempesta fw]   init: filter
[  111.021545] [tempesta fw]   init: cache
[  111.021970] [tempesta fw]   init: http_sess
[  111.022433] [tempesta fw]   init: websocket
[  111.022928] [tempesta fw]   init: sync_socket
[  111.023593] [tempesta fw]   init: server
[  111.023983] [tempesta fw]   init: client
[  111.024226] [tempesta fw]   init: sock_srv
[  111.024492] [tempesta fw]   init: sock_clnt
[  111.024780] [tempesta fw]   init: procfs
[  111.025027] [tempesta fw]   init: http_tbl
[  111.025281] [tempesta fw]   init: sched_hash
[  111.025546] [tempesta fw]   sched_hash: init
[  111.025824] [tempesta fw]   Registering new scheduler: hash
[  111.026173] [tempesta fw]   init: sched_ratio
[  111.026454] [tempesta fw]   ratio: init
[  111.026697] [tempesta fw]   Registering new scheduler: ratio
[  111.036724] [tempesta fw]   Preparing for the configuration processing.
[  111.070870] [tempesta fw] Warning: Vhost default doesn't have certificate with matching SAN/CN.
                   Maybe that's fine, but it's worth checking the
                   config - if there is no relations between the
                   names, then host name confusion attack is possible.
[  111.074035] [tempesta tls] Warning: PK - Elliptic curve with OID 1.2.840.10045.3.1.1 is unsupported
[  111.075141] [tempesta fw] ERROR: tls_certificate_key: Invalid private key specified (16)
[  111.076112] [tempesta fw] ERROR: configuration parsing error:
                  5:         tls_certificate_key /tmp/host/tempesta.key;
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[  111.078316] [tempesta fw] Warning: Configuration parsing has failed. Clean up...
[  111.098803] [tempesta fw]   New configuration is cleaned.
[  111.099481] [tempesta fw]   Preparing for the configuration processing.
[  111.122835] [tempesta fw] Warning: Vhost default doesn't have certificate with matching SAN/CN.
                   Maybe that's fine, but it's worth checking the
                   config - if there is no relations between the
                   names, then host name confusion attack is possible.
[  111.126008] [tempesta tls] Warning: PK - Elliptic curve with OID 1.2.840.10045.3.1.1 is unsupported
[  111.127115] [tempesta fw] ERROR: tls_certificate_key: Invalid private key specified (16)
[  111.128089] [tempesta fw] ERROR: configuration parsing error:
                  5:         tls_certificate_key /tmp/host/tempesta.key;
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[  111.130301] [tempesta fw] Warning: Configuration parsing has failed. Clean up...
[  111.150798] [tempesta fw]   New configuration is cleaned.
[  111.152592] BUG: Bad page state in process tempesta.sh  pfn:14ab58
[  111.153372] page:0000000086a32276 refcount:-1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14ab58
[  111.154519] flags: 0x17ffffc0000000()
[  111.154974] raw: 0017ffffc0000000 dead000000000100 dead000000000122 0000000000000000
[  111.155907] raw: 0000000000000000 0000000000000000 ffffffffffffffff 0000000000000000
[  111.156841] page dumped because: nonzero _refcount
[  111.157422] Modules linked in: tempesta_fw(OE) tempesta_db(OE) tempesta_tls(OE) tempesta_lib(OE) sha256_ssse3(E) sha512_ssse3(E) sha512_generic(E) uinput(E) xt_conntrack(E) nft_chain_nat(E) xt_MASQUERADE(E) nf_nat(E) nf_conntrack_netlink(E) nf_conntrack(E) nf_defrag_ipv6(E) nf_defrag_ipv4(E) xfrm_user(E) xfrm_algo(E) nft_counter(E) xt_addrtype(E) nft_compat(E) nf_tables(E) libcrc32c(E) nfnetlink(E) br_netfilter(E) bridge(E) stp(E) llc(E) joydev(E) hid_generic(E) usbhid(E) hid(E) rfkill(E) overlay(E) crc32_pclmul(E) ghash_clmulni_intel(E) snd_hda_codec_generic(E) ledtrig_audio(E) snd_hda_intel(E) snd_intel_dspcfg(E) soundwire_intel(E) aesni_intel(E) soundwire_generic_allocation(E) libaes(E) snd_soc_core(E) crypto_simd(E) cryptd(E) glue_helper(E) snd_compress(E) ahci(E) soundwire_cadence(E) libahci(E) snd_hda_codec(E) iTCO_wdt(E) xhci_pci(E) intel_pmc_bxt(E) iTCO_vendor_support(E) snd_hda_core(E) watchdog(E) virtio_net(E) snd_hwdep(E) xhci_hcd(E) soundwire_bus(E) net_failover(E) snd_pcm(E)
[  111.157467]  libata(E) snd_timer(E) failover(E) pcspkr(E) virtiofs(E) i2c_i801(E) snd(E) usbcore(E) soundcore(E) scsi_mod(E) virtio_balloon(E) virtio_console(E) lpc_ich(E) i2c_smbus(E) qemu_fw_cfg(E) button(E) msr(E) parport_pc(E) ppdev(E) lp(E) parport(E) fuse(E) configfs(E) virtio_rng(E) rng_core(E) ip_tables(E) x_tables(E) autofs4(E) ext4(E) crc32c_generic(E) crc16(E) mbcache(E) jbd2(E) virtio_gpu(E) virtio_dma_buf(E) drm_kms_helper(E) cec(E) drm(E) virtio_blk(E) crct10dif_pclmul(E) crct10dif_common(E) psmouse(E) crc32c_intel(E) evdev(E) serio_raw(E) virtio_pci(E) virtio_ring(E) virtio(E) [last unloaded: tempesta_lib]
[  111.174294] CPU: 3 PID: 5373 Comm: tempesta.sh Kdump: loaded Tainted: G           OE     5.10.35+ #135
[  111.175403] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS Arch Linux 1.16.2-1-1 04/01/2014
[  111.176503] Call Trace:
[  111.176832]  dump_stack+0x6b/0x83
[  111.177246]  bad_page.cold+0x9b/0xa0
[  111.177738]  get_page_from_freelist+0xd04/0x1410
[  111.178305]  __alloc_pages_nodemask+0x15d/0x300
[  111.178853]  __get_free_pages+0xd/0x40
[  111.179315]  pgd_alloc+0x33/0x200
[  111.179727]  mm_init+0x1ac/0x280
[  111.180134]  dup_mm+0x66/0x570
[  111.180512]  ? __lock_task_sighand+0x3a/0x70
[  111.181029]  copy_process+0x1901/0x1a70
[  111.181497]  kernel_clone+0x98/0x3c0
[  111.181934]  __do_sys_clone+0x72/0x90
[  111.182381]  do_syscall_64+0x33/0x80
[  111.182821]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[  111.183441] RIP: 0033:0x7f4a4fcd0e7b
[  111.183877] Code: ed 0f 85 f8 00 00 00 64 4c 8b 0c 25 10 00 00 00 45 31 c0 4d 8d 91 d0 02 00 00 31 d2 31 f6 bf 11 00 20 01 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 91 00 00 00 41 89 c5 85 c0 0f 85 9e 00 00
[  111.186112] RSP: 002b:00007ffe922df660 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
[  111.187025] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f4a4fcd0e7b
[  111.187876] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
[  111.188727] RBP: 0000000000000000 R08: 0000000000000000 R09: 00007f4a4fc05740
[  111.189579] R10: 00007f4a4fc05a10 R11: 0000000000000246 R12: 0000000000000000
[  111.190437] R13: 00007ffe922df7b0 R14: 0000565299db9b8e R15: 000056529ac3d7f0
[  111.191294] Disabling lock debugging due to kernel taint
[  111.191933] BUG: Bad page state in process tempesta.sh  pfn:18a5c6
[  111.192675] page:00000000e9877b81 refcount:-1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x18a5c6
[  111.193811] flags: 0x17ffffc0000000()
[  111.194260] raw: 0017ffffc0000000 dead000000000100 dead000000000122 0000000000000000
[  111.195185] raw: 0000000000000000 0000000000000000 ffffffffffffffff 0000000000000000
[  111.196106] page dumped because: nonzero _refcount
[  111.196682] Modules linked in: tempesta_fw(OE) tempesta_db(OE) tempesta_tls(OE) tempesta_lib(OE) sha256_ssse3(E) sha512_ssse3(E) sha512_generic(E) uinput(E) xt_conntrack(E) nft_chain_nat(E) xt_MASQUERADE(E) nf_nat(E) nf_conntrack_netlink(E) nf_conntrack(E) nf_defrag_ipv6(E) nf_defrag_ipv4(E) xfrm_user(E) xfrm_algo(E) nft_counter(E) xt_addrtype(E) nft_compat(E) nf_tables(E) libcrc32c(E) nfnetlink(E) br_netfilter(E) bridge(E) stp(E) llc(E) joydev(E) hid_generic(E) usbhid(E) hid(E) rfkill(E) overlay(E) crc32_pclmul(E) ghash_clmulni_intel(E) snd_hda_codec_generic(E) ledtrig_audio(E) snd_hda_intel(E) snd_intel_dspcfg(E) soundwire_intel(E) aesni_intel(E) soundwire_generic_allocation(E) libaes(E) snd_soc_core(E) crypto_simd(E) cryptd(E) glue_helper(E) snd_compress(E) ahci(E) soundwire_cadence(E) libahci(E) snd_hda_codec(E) iTCO_wdt(E) xhci_pci(E) intel_pmc_bxt(E) iTCO_vendor_support(E) snd_hda_core(E) watchdog(E) virtio_net(E) snd_hwdep(E) xhci_hcd(E) soundwire_bus(E) net_failover(E) snd_pcm(E)
[  111.196712]  libata(E) snd_timer(E) failover(E) pcspkr(E) virtiofs(E) i2c_i801(E) snd(E) usbcore(E) soundcore(E) scsi_mod(E) virtio_balloon(E) virtio_console(E) lpc_ich(E) i2c_smbus(E) qemu_fw_cfg(E) button(E) msr(E) parport_pc(E) ppdev(E) lp(E) parport(E) fuse(E) configfs(E) virtio_rng(E) rng_core(E) ip_tables(E) x_tables(E) autofs4(E) ext4(E) crc32c_generic(E) crc16(E) mbcache(E) jbd2(E) virtio_gpu(E) virtio_dma_buf(E) drm_kms_helper(E) cec(E) drm(E) virtio_blk(E) crct10dif_pclmul(E) crct10dif_common(E) psmouse(E) crc32c_intel(E) evdev(E) serio_raw(E) virtio_pci(E) virtio_ring(E) virtio(E) [last unloaded: tempesta_lib]
[  111.212999] CPU: 3 PID: 5373 Comm: tempesta.sh Kdump: loaded Tainted: G    B      OE     5.10.35+ #135
[  111.214230] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS Arch Linux 1.16.2-1-1 04/01/2014
[  111.215589] Call Trace:
[  111.215971]  dump_stack+0x6b/0x83
[  111.216476]  bad_page.cold+0x9b/0xa0
[  111.217033]  get_page_from_freelist+0xd04/0x1410
[  111.217726]  __alloc_pages_nodemask+0x15d/0x300
[  111.218402]  __get_free_pages+0xd/0x40
[  111.218967]  pgd_alloc+0x33/0x200
[  111.219489]  mm_init+0x1ac/0x280
[  111.219982]  dup_mm+0x66/0x570
[  111.220463]  ? __lock_task_sighand+0x3a/0x70
[  111.220978]  copy_process+0x1901/0x1a70
[  111.221351]  kernel_clone+0x98/0x3c0
[  111.221707]  __do_sys_clone+0x72/0x90
[  111.222065]  do_syscall_64+0x33/0x80
[  111.222415]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[  111.222902] RIP: 0033:0x7f4a4fcd0e7b
[  111.223250] Code: ed 0f 85 f8 00 00 00 64 4c 8b 0c 25 10 00 00 00 45 31 c0 4d 8d 91 d0 02 00 00 31 d2 31 f6 bf 11 00 20 01 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 91 00 00 00 41 89 c5 85 c0 0f 85 9e 00 00
[  111.225030] RSP: 002b:00007ffe922df660 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
[  111.225751] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f4a4fcd0e7b
[  111.226430] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
[  111.227117] RBP: 0000000000000000 R08: 0000000000000000 R09: 00007f4a4fc05740
[  111.227798] R10: 00007f4a4fc05a10 R11: 0000000000000246 R12: 0000000000000000
[  111.228477] R13: 00007ffe922df7b0 R14: 0000565299db9b8e R15: 000056529ac3d7f0
[  111.237080] [tempesta fw] exiting...
[  111.254843] [tempesta fw]   ratio: exit
[  111.255367] [tempesta fw]   Un-registering scheduler: ratio
[  111.256080] [tempesta fw]   sched_hash: exit
[  111.256604] [tempesta fw]   Un-registering scheduler: hash
[  111.270830] [tempesta fw]   frang exit
[  111.310670] [tdb] Shutdown Tempesta DB
[  111.425657] End test:   tls.test_tls_cert.InvalidKeyWithGoodCert.test
EvgeniiMekhanik commented 11 months ago

Try on the new master. I fix this problem in the tempesta.