Skip to content

Commit dcf6cca

Browse files
authored
Merge pull request #793 from deXol/developBleTOTPCredentials
[BLE] TOTP secret length increase to 64 bytes
2 parents 0d7d998 + fb6f4b3 commit dcf6cca

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/MPDeviceBleImpl.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ void MPDeviceBleImpl::createTOTPCredMessage(const QString &service, const QStrin
659659
QByteArray loginArr = bleProt->toByteArray(login);
660660
Common::fill(loginArr, MPNodeBLE::LOGIN_LENGTH - loginArr.size(), ZERO_BYTE);
661661
data.append(loginArr);
662-
// 380->411 TOTP secret key
662+
// 380->443 TOTP secret key
663663
QByteArray secKeyArr;
664664
secKeyArr.append(secretKey);
665665
if (secKeyArr.length() > SECRET_KEY_LENGTH)
@@ -669,13 +669,13 @@ void MPDeviceBleImpl::createTOTPCredMessage(const QString &service, const QStrin
669669
}
670670
Common::fill(secKeyArr, SECRET_KEY_LENGTH - secKeyArr.size(), ZERO_BYTE);
671671
data.append(secKeyArr);
672-
// 412 TOTP secret key length
672+
// 444 TOTP secret key length
673673
data.append(secretKey.size());
674-
// 413 TOTP number of digits
674+
// 445 TOTP number of digits
675675
data.append(codeSize);
676-
// 414 TOTP time step
676+
// 456 TOTP time step
677677
data.append(timeStep);
678-
// 415 TOTP SHA version
678+
// 447 TOTP SHA version
679679
data.append(ZERO_BYTE);
680680

681681
mmmTOTPStoreArray.append(data);

src/MPDeviceBleImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public slots:
222222
const static int FIRST_DATA_STARTING_ADDR = 10;
223223
const static int STATUS_MSG_SIZE_WITH_BATTERY = 5;
224224
const static int BATTERY_BYTE = 1;
225-
const static int SECRET_KEY_LENGTH = 32;
225+
const static int SECRET_KEY_LENGTH = 64;
226226
static constexpr int UPLOAD_PASSWORD_BYTE_SIZE = 16;
227227
const QByteArray DEFAULT_BUNDLE_PASSWORD = "\x63\x44\x31\x91\x3a\xfd\x23\xff\xb3\xac\x93\x69\x22\x5b\xf3\xc0";
228228
};

src/Mooltipass/MPNodeBLE.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class MPNodeBLE : public MPNode
5959
static constexpr int KEY_AFTER_LOGIN_ADDR_START = 260;
6060
static constexpr int KEY_AFTER_PWD_ADDR_START = 262;
6161
static constexpr int PWD_BLANK_FLAG = 266;
62-
static constexpr int TOTP_TIME_STEP = 434;
63-
static constexpr int TOTP_CODE_SIZE = 436;
62+
static constexpr int TOTP_TIME_STEP = 466;
63+
static constexpr int TOTP_CODE_SIZE = 468;
6464
static constexpr int KEY_AFTER_LENGTH = 2;
6565
static constexpr char BLANK_CHAR = 0x01;
6666
};

src/TOTPCredential.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</size>
6363
</property>
6464
<property name="maxLength">
65-
<number>48</number>
65+
<number>72</number>
6666
</property>
6767
</widget>
6868
</item>

0 commit comments

Comments
 (0)