SHA256
Разделить среды и закрепить лицензии в HEADER 1.0
This commit is contained in:
@@ -137,7 +137,7 @@ function parseTechBody(subType, body, frame) {
|
||||
seen.add(previous.toLowerCase());
|
||||
}
|
||||
}
|
||||
const license = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(reader.raw(frame.version === 2 ? reader.u16('HEADER license length') : reader.u8('HEADER license length'), 'HEADER license'));
|
||||
const license = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(reader.raw(reader.u16('HEADER license length'), 'HEADER license'));
|
||||
const initialBlockchainKey = bytesToBase64Url(reader.raw(32, 'initialBlockchainKey32'));
|
||||
if (reader.remaining() !== 0) throw new Error('Неожиданные данные после HEADER');
|
||||
return { kind: 'header', magic, login, license, accountType, previousAccounts, initialBlockchainKey };
|
||||
@@ -247,7 +247,7 @@ function parseStatusBody(subType, body) {
|
||||
}
|
||||
|
||||
function parseBody(type, subType, version, body, frame) {
|
||||
if (version !== 1 && !(type === 0 && subType === 0 && version === 2)) {
|
||||
if (version !== 1) {
|
||||
return { kind: 'unsupported_version', rawBodyLength: body.length };
|
||||
}
|
||||
if (type === 0) return parseTechBody(subType, body, frame);
|
||||
|
||||
Reference in New Issue
Block a user