https://bugs.kde.org/show_bug.cgi?id=411986
Bug ID: 411986 Summary: [PATCH] Simplify attended password, multi case/character is too hard to read out over the phone for support Product: krfb Version: unspecified Platform: Other OS: Linux Status: REPORTED Severity: normal Priority: NOR Component: general Assignee: grundleb...@googlemail.com Reporter: bernard.g...@gmail.com Target Milestone: --- Created attachment 122685 --> https://bugs.kde.org/attachment.cgi?id=122685&action=edit patch SUMMARY The current attended password format is simply too complicated for users to read out over the phone. This patch simplifies it to a 4 digit integer, patch from the current github master --- a/krfb/invitationsrfbserver.cpp +++ b/krfb/invitationsrfbserver.cpp @@ -110,7 +110,7 @@ void InvitationsRfbServer::toggleUnattendedAccess(bool allow) InvitationsRfbServer::InvitationsRfbServer() { - m_desktopPassword = readableRandomString(4) + QLatin1Char('-') + readableRandomString(3); + m_desktopPassword = readableRandomFourDigits(); m_unattendedPassword = readableRandomString(4) + QLatin1Char('-') + readableRandomString(3); KConfigGroup krfbConfig(KSharedConfig::openConfig(),"Security"); m_allowUnattendedAccess = krfbConfig.readEntry( @@ -207,6 +207,19 @@ void InvitationsRfbServer::walletOpened(bool opened) } } +// a random string made up of numbers for easy readability +// based on KRandom::random() +QString InvitationsRfbServer::readableRandomFourDigits() +{ + int r = KRandom::random(); + while (r < 1000) { + r = KRandom::random(); + } + QString str = QString::number(r); + str.resize(4); + return str; +} + // a random string that doesn't contain i, I, o, O, 1, l, 0 // based on KRandom::randomString() QString InvitationsRfbServer::readableRandomString(int length) diff --git a/krfb/invitationsrfbserver.h b/krfb/invitationsrfbserver.h index 6b6b16d..cc54a29 100644 --- a/krfb/invitationsrfbserver.h +++ b/krfb/invitationsrfbserver.h @@ -68,6 +68,7 @@ private: QString m_unattendedPassword; KWallet::Wallet *m_wallet; + QString readableRandomFourDigits(); QString readableRandomString(int); Q_DISABLE_COPY(InvitationsRfbServer) }; -- You are receiving this mail because: You are watching all bug changes.