summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslellipticcurve_openssl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/ssl/qsslellipticcurve_openssl.cpp')
-rw-r--r--src/network/ssl/qsslellipticcurve_openssl.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/network/ssl/qsslellipticcurve_openssl.cpp b/src/network/ssl/qsslellipticcurve_openssl.cpp
index d8d1307b2e..e8f6cfee9e 100644
--- a/src/network/ssl/qsslellipticcurve_openssl.cpp
+++ b/src/network/ssl/qsslellipticcurve_openssl.cpp
@@ -103,6 +103,26 @@ QSslEllipticCurve QSslEllipticCurve::fromShortName(const QString &name)
return result;
}
+QSslEllipticCurve QSslEllipticCurve::fromLongName(const QString &name)
+{
+ if (name.isEmpty())
+ return QSslEllipticCurve();
+
+ QSslSocketPrivate::ensureInitialized();
+
+ QSslEllipticCurve result;
+
+#ifndef OPENSSL_NO_EC
+ const QByteArray curveNameLatin1 = name.toLatin1();
+
+ int nid = q_OBJ_ln2nid(curveNameLatin1.data());
+ result.id = nid;
+#endif
+
+ return result;
+}
+
+
// The brainpool curve NIDs (RFC 7027) have been introduced in OpenSSL 1.0.2,
// redefine them here to make Qt compile with previous versions of OpenSSL
// (yet correctly recognize them as TLS named curves).