diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.cpp b/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.cpp index 6d7eeec3a44..cf2220012fc 100644 --- a/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.cpp +++ b/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.cpp @@ -249,11 +249,6 @@ bool BlackBerryDeviceConfigurationWizardSshKeyPage::saveKeys(const QByteArray &p Utils::FileSaver pubSaver(publicKeyPath); - // blackberry-connect requires an @ character to be included in the RSA comment - const QString atHost = QLatin1Char('@') + QHostInfo::localHostName(); - QByteArray pubKeyContent = publicKey; - pubKeyContent.append(atHost.toLocal8Bit()); - pubSaver.write(publicKey); if (!pubSaver.finalize(this)) return false; diff --git a/src/plugins/qnx/blackberrysshkeysgenerator.cpp b/src/plugins/qnx/blackberrysshkeysgenerator.cpp index 3be7a6eea52..d9b10c0b0f5 100644 --- a/src/plugins/qnx/blackberrysshkeysgenerator.cpp +++ b/src/plugins/qnx/blackberrysshkeysgenerator.cpp @@ -53,8 +53,20 @@ void BlackBerrySshKeysGenerator::run() const bool success = m_keyGen->generateKeys(QSsh::SshKeyGenerator::Rsa, QSsh::SshKeyGenerator::Mixed, 4096, QSsh::SshKeyGenerator::DoNotOfferEncryption); - if (success) - emit sshKeysGenerationFinished(m_privateKeyPath, m_keyGen->privateKey(), m_keyGen->publicKey()); - else + if (success) { + // BB10 devices allow to use public key with no comment + // or a comment in username@hostname format + // QSsh::SshKeyGenerator class creates comments in 'QtCreator/TIMEZONE' format + // therefore stripping this comment out + QByteArray publicKey = m_keyGen->publicKey(); + int firstSpace = publicKey.indexOf(' '); + if (firstSpace >= 0) { + int secondSpace = publicKey.indexOf(' ', firstSpace + 1); + if (secondSpace >= 0) + publicKey.truncate(secondSpace); + } + + emit sshKeysGenerationFinished(m_privateKeyPath, m_keyGen->privateKey(), publicKey); + } else emit sshKeysGenerationFailed(m_keyGen->error()); }