Summary: | Plasma-nm crashed every time when configuring WPA2-Enterprise Wifi with EAP-TLS with public key only CA certificate file | ||
---|---|---|---|
Product: | [Plasma] plasma-nm | Reporter: | einbert-xeride |
Component: | editor | Assignee: | Jan Grulich <jgrulich> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | jgrulich, nate |
Priority: | NOR | ||
Version: | 5.19.1 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=423355 | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Stacktrace with plasma-nm recompiled with debug symbols |
Description
einbert-xeride
2020-06-22 09:19:04 UTC
Created attachment 129576 [details]
Stacktrace with plasma-nm recompiled with debug symbols
Can you install debug symbols for qt-qca2? Any chance this or similar certificate can be downloaded somewhere so I can try? (In reply to Jan Grulich from comment #2) > Can you install debug symbols for qt-qca2? Any chance this or similar > certificate can be downloaded somewhere so I can try? Debug symbols for `qca` (arch linux package name) is actually installed by recompiled it from source, enable "debug" and disable "strip" in /etc/makepkg.conf ------------ After investigation, seems that the crash is actually caused by private key, not CA certificate file. Test code: ``` #include <QtCrypto> #include <QDebug> int main() { QCA::Initializer init; qDebug() << "isSupported(\"pkcs12\"):" << QCA::isSupported("pkcs12"); // got "true" QCA::ConvertResult convRes; QCA::KeyBundle keyBundle = QCA::KeyBundle::fromFile("/opt/****/cert.p12", "************", &convRes); qDebug() << "convRes:" << convRes; // got "0" const QCA::PrivateKey pkey = keyBundle.privateKey(); // QCA::PrivateKey::canDecrypt() calls QCA::PrivateKey::isRSA() // which calls QCA::PrivateKey::type() // which calls `static_cast<const PKeyContext *>(context())->key()->type()` const QCA::Provider::Context *context = pkey.context(); auto pkey_context = static_cast<const QCA::PKeyContext *>(context); const QCA::PKeyBase *pkey_base = pkey_context->key(); // got nullptr const QCA::PKey::Type pkey_type = pkey_base->type(); // segmentation fault qDebug() << "pkey_type:" << pkey_type; return 0; } ``` I'm not that much familiar with QCA2, can you maybe open a bug there to see if this is something expected and problem on our side or if it's a bug there? (In reply to Jan Grulich from comment #4) > I'm not that much familiar with QCA2, can you maybe open a bug there to see > if this is something expected and problem on our side or if it's a bug there? I'm also not familiar with QCA2 (didn't know what's it before investigate into this issue). I may try my best to find the root cause. Turns out that it may be QCA2's fault. Stacktrace: #0 opensslQCAPlugin::MyPKeyContext::pkeyToBase #1 opensslQCAPlugin::MyPKCS12Context::fromPKCS12 #2 QCA::get_pkcs12_der #3 QCA::KeyBundle::fromFile In opensslQCAPlugin::MyPKeyContext::pkeyToBase, the pkey_type it got was 408, which is EVP_PKEY_EC. pkeyToBase only supports EVP_PKEY_RSA, EVP_PKEY_DSA and EVP_PKEY_DH. For unknown types, it returns nullptr, and opensslQCAPlugin::MyPKCS12Context::fromPKCS12 doesn't check the return value. That nullptr is what we get from pkey_context->key(). Have no idea if it's intended or it's a bug. I may open another bug for QCA2 later. QCA bug opened at https://bugs.kde.org/show_bug.cgi?id=423355. Manually patched https://invent.kde.org/libraries/qca/-/merge_requests/30 to qca 2.3.0 and plasma-nm didn't crash any more, so mark this bug as RESOLVED FIXED as well. Great. Thank you for your collaboration. |