Skip to content

Commit c213bde

Browse files
committed
protoDefinition
1 parent 50bec51 commit c213bde

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

index.html

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,37 +1143,43 @@ <h2 style="text-align: center;">Settings</h2>
11431143
}
11441144

11451145
const protoDefinition = {
1146-
MigrationPayload: {
1146+
Payload: {
11471147
fields: {
11481148
otp_parameters: { type: "OtpParameters", repeated: true, id: 1 },
11491149
version: { type: "int32", id: 2 },
11501150
batch_size: { type: "int32", id: 3 },
11511151
batch_index: { type: "int32", id: 4 },
1152-
omitted_values: { type: "int32", id: 5 }
1152+
batch_id: { type: "int32", id: 5 }
11531153
}
11541154
},
11551155
OtpParameters: {
11561156
fields: {
11571157
secret: { type: "bytes", id: 1 },
11581158
name: { type: "string", id: 2 },
11591159
issuer: { type: "string", id: 3 },
1160-
type: { type: "OtpType", id: 4 },
1161-
algorithm: { type: "Algorithm", id: 5 },
1162-
digits: { type: "int32", id: 6 },
1163-
counter: { type: "int64", id: 7 }
1160+
algorithm: { type: "Algorithm", id: 4 },
1161+
digits: { type: "DigitCount", id: 5 },
1162+
type: { type: "OtpType", id: 6 },
1163+
counter: { type: "uint64", id: 7 },
1164+
unique_id: { type: "string", id: 8 }
11641165
}
11651166
},
11661167
OtpType: {
11671168
0: "OTP_TYPE_UNSPECIFIED",
1168-
1: "TOTP",
1169-
2: "HOTP"
1169+
1: "HOTP",
1170+
2: "TOTP"
11701171
},
11711172
Algorithm: {
11721173
0: "ALGORITHM_UNSPECIFIED",
11731174
1: "SHA1",
11741175
2: "SHA256",
11751176
3: "SHA512",
11761177
4: "MD5"
1178+
},
1179+
DigitCount: {
1180+
0: "DIGIT_COUNT_UNSPECIFIED",
1181+
1: "6",
1182+
2: "8"
11771183
}
11781184
};
11791185

@@ -1220,6 +1226,7 @@ <h2 style="text-align: center;">Settings</h2>
12201226
const { value, length } = readVarint(slice, ipos); ipos += length;
12211227
if (def.type === "OtpType") param[name] = parseEnum(protoDefinition.OtpType, value);
12221228
else if (def.type === "Algorithm") param[name] = parseEnum(protoDefinition.Algorithm, value);
1229+
else if (def.type === "DigitCount") param[name] = parseEnum(protoDefinition.DigitCount, value);
12231230
else param[name] = value;
12241231
} else if (wt === 2) {
12251232
const { value: l, length: ll } = readVarint(slice, ipos); ipos += ll;
@@ -1248,7 +1255,7 @@ <h2 style="text-align: center;">Settings</h2>
12481255
const keyOptions = prepareKey({
12491256
accountName: param.name,
12501257
issuer: param.issuer,
1251-
digits: 6,
1258+
digits: param.digits,
12521259
period: param.period,
12531260
algorithm: param.algorithm
12541261
}, { shortImport: false });

0 commit comments

Comments
 (0)