Commit 68f986f1 authored by calocedre TAC's avatar calocedre TAC
Browse files

Merge branch 'spec/countrycode-to-reserved' into 'master'

Spec/countrycode to reserved

See merge request !28
parents 0d8a7744 d82b40f6
Pipeline #238129 passed with stages
in 10 minutes and 57 seconds
......@@ -66,10 +66,10 @@ Test #3 passed
>./test_ecies
Usage: ./test_ecies random priv_key data
> test_clea
> simple_clea
AE7ovhtS8OmTGOVkk/5kcp6G0r5FBDCbQQffyCRE4U5LSG2Muxk12q/iWhpnHVucPMIkAJ5UZVFnfGHjmt3B8xFVERSoCT0fiBtFE7GGZUSQVvvZJ3ujtdLTqVVsO2ONOsAuRqHNOqXdzlQlWzua2X2qOahDScgC1IHe00ftKR6aOrdCpn1ZA2XJeWmt6wIyJX+XKF/qUqL7/p0Bj9NvorGxWRmIST3c+OFHkbBLsw==
AE7ovhtS8OmTGOVkk/5kcp6yyiQaTivN8kC8MT9FaGlcMYXetqJm9hzUQZhlvV4DQFrPdXASsNuHPfrbQWHkwLtktrEj/y6DuTwQz774KyVtknUE6oMpBp8inzQaHx4mrimPqQa1vEkI7BiRKKbtcVYT6H7LYcHZq5sOKCIE4Pmm6mJcGXmU6CJWMhVZpAORdEQswqnR9k1gNibRhhQhVmzs+WAGVOGJeANUyj+rzA==
> ./build_clea
Usage: build_clea staff CRIexp venueType venueCategory1 venueCategory2 countryCode periodDuration locationPhone locationPin PK_SA PK_MCTA
> ./test_clea
Usage: build_clea staff CRIexp venueType venueCategory1 venueCategory2 periodDuration locationPhone locationPin PK_SA PK_MCTA
```
......@@ -6,12 +6,12 @@
#include "clea.h"
static uint32_t t_periodStart; // Starting time of the period, NTP UTC timestamp limited to the 32-bit seconds field (starting at a round hour)
static uint8_t LTKey[SHA256_DIGEST_SIZE]; // Temporary location secret key
uint8_t LTKey[SHA256_DIGEST_SIZE]; // Temporary location secret key
static uint8_t LTId[16]; // Temporary location public universally unique Identifier
static const uint8_t version = 0;
static const uint8_t qrType = 0;
static void compute_TLKey(void);
static void compute_LTKey(void);
static void to_base64(uint8_t *in, uint8_t *out, uint8_t n);
static uint32_t get_ntp_utc(bool round);
......@@ -24,7 +24,7 @@ int32_t clea_start_new_period(uint8_t ptr_LTId[16], uint32_t *ptr_ct_periodStart
{
t_periodStart = get_ntp_utc(true);
compute_TLKey();
compute_LTKey();
// Compute LTId
hmac_sha256_128(LTKey, sizeof(LTKey), (uint8_t *)"1", 1, LTId);
......@@ -62,8 +62,9 @@ int32_t clea_renew_qrcode(uint32_t *ptr_ct_periodStart, uint32_t *ptr_t_qrStart)
LSP[cpt++] = LTId[i];
}
LSP[cpt++] = (c->staff & 0x1) << 7 | ((c->locContactMsgPresent & 0x1) << 6) | ((c->countryCode & 0xFC0) >> 6);
LSP[cpt++] = ((c->countryCode & 0x3F) << 2) | ((c->CRIexp & 0x18) >> 3);
uint8_t reserved = 0x0; /* 12 bits reserved for the spec. evolution */
LSP[cpt++] = (c->staff & 0x1) << 7 | ((c->locContactMsgPresent & 0x1) << 6) | ((reserved & 0xFC0) >> 6);
LSP[cpt++] = ((reserved & 0x3F) << 2) | ((c->CRIexp & 0x18) >> 3);
LSP[cpt++] = ((c->CRIexp & 0x7) << 5) | (c->venueType & 0x1F);
LSP[cpt++] = ((c->venueCategory1 & 0xF) << 4) | (c->venueCategory2 & 0xF);
LSP[cpt++] = c->periodDuration;
......@@ -138,7 +139,7 @@ int32_t clea_renew_qrcode(uint32_t *ptr_ct_periodStart, uint32_t *ptr_t_qrStart)
return 0;
}
static void compute_TLKey(void)
static void compute_LTKey(void)
{
static uint8_t buffer[64]; // 512-bit input data buffer
uint8_t i;
......
......@@ -2,6 +2,7 @@
#define CLEA_H__
#include <stdint.h>
#include "hash/sha256.h"
#define SK_L_SIZE (51)
......@@ -30,7 +31,6 @@ typedef struct
uint8_t venueType; // 5 bits
uint8_t venueCategory1; // 4 bits
uint8_t venueCategory2; // 4 bits
uint16_t countryCode; // 12 bits
uint8_t periodDuration; // 8 bits: period duration in hours
// Location contact
......@@ -44,6 +44,8 @@ extern clea_conf_t clea_conf;
#define LSP_BASE64_SIZE (237)
extern uint8_t LSP_base64[LSP_BASE64_SIZE];
extern uint8_t LTKey[SHA256_DIGEST_SIZE]; // Temporary location secret key
void clea_init(void);
int32_t clea_start_new_period(uint8_t ptr_LTId[16], uint32_t *ptr_ct_periodStart, uint32_t *ptr_t_qrStart);
......
......@@ -15,7 +15,6 @@ clea_conf_t clea_conf =
.venueType = 10,
.venueCategory1 = 0,
.venueCategory2 = 0,
.countryCode = 250, // France numeric code as defined in ISO3166-1
.periodDuration = 3, // 3 hours
.locationPhone = {0x33, 0x80, 0x01, 0x30, 0x00, 0x0F, 0xFF, 0xFF}, // +33 800 130 000
.locationRegion = 11,
......
......@@ -25,7 +25,6 @@ clea_conf_t clea_conf =
.venueType = 10,
.venueCategory1 = 0,
.venueCategory2 = 0,
.countryCode = 250, // France
.periodDuration = 1, // 1 hour
.locationPhone = {0x33, 0x80, 0x01, 0x30, 0x00, 0x0F, 0xFF, 0xFF}, // +33 800 130 000
.locationPin = {0xDE, 0xAD, 0xBE, 0xEF} // "DEADBEEF"
......
......@@ -29,10 +29,19 @@ void print_uuid(uint8_t uuid[16])
uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]);
}
void print_hex(uint8_t key[SHA256_DIGEST_SIZE])
{
for (int i = 0; i < SHA256_DIGEST_SIZE; i++)
{
printf("%02x", key[i]);
}
}
void usage(char *s, char *err)
{
printf("ERROR: %s\n\n", err);
printf("Usage: %s staff countryCode CRIexp venueType venueCategory1 venueCategory2 periodDuration PK_SA PK_MCTA SK_L [locationPhone locationRegion locationPin]\n\n", s);
printf("Usage: %s staff CRIexp venueType venueCategory1 venueCategory2 periodDuration PK_SA PK_MCTA SK_L [locationPhone locationRegion locationPin]\n\n", s);
printf("locationPhone: 15-digit-max international phone number\n");
printf("locationPin: 8-digit-max pin code\n");
exit(1);
......@@ -49,31 +58,30 @@ int main(int argc, char *argv[])
uint32_t t_qrStart, ct_periodStart;
uint8_t LTId[16];
if ((argc == 14) || (argc == 11))
if ((argc == 13) || (argc == 10))
{
clea_conf.staff = atoi(argv[1]);
clea_conf.locContactMsgPresent = (argc == 14);
clea_conf.countryCode = atoi(argv[2]);
clea_conf.CRIexp = atoi(argv[3]);
clea_conf.venueType = atoi(argv[4]);
clea_conf.venueCategory1 = atoi(argv[5]);
clea_conf.venueCategory2 = atoi(argv[6]);
clea_conf.periodDuration = atoi(argv[7]);
clea_conf.locContactMsgPresent = (argc == 13);
clea_conf.CRIexp = atoi(argv[2]);
clea_conf.venueType = atoi(argv[3]);
clea_conf.venueCategory1 = atoi(argv[4]);
clea_conf.venueCategory2 = atoi(argv[5]);
clea_conf.periodDuration = atoi(argv[6]);
// Skip "04" for uncompressed keys
parse(&(argv[8][2]), PK_SA);
parse(&(argv[9][2]), PK_MCTA);
parse(argv[10], SK_L);
parse(&(argv[7][2]), PK_SA);
parse(&(argv[8][2]), PK_MCTA);
parse(argv[9], SK_L);
if (clea_conf.locContactMsgPresent)
{
if (parse_bcd(argv[11], clea_conf.locationPhone, sizeof(clea_conf.locationPhone)))
if (parse_bcd(argv[10], clea_conf.locationPhone, sizeof(clea_conf.locationPhone)))
{
USAGE("Too many digits in locationPhone");
}
clea_conf.locationRegion = atoi(argv[12]);
clea_conf.locationRegion = atoi(argv[11]);
if (parse_bcd(argv[13], clea_conf.locationPin, sizeof(clea_conf.locationPin)))
if (parse_bcd(argv[12], clea_conf.locationPin, sizeof(clea_conf.locationPin)))
{
USAGE("Too many digits in locationPin");
}
......@@ -91,7 +99,9 @@ int main(int argc, char *argv[])
printf("=VALUES=");
print_qrcode();
print_uuid(LTId);
printf(" %lu %lu\n",ct_periodStart, t_qrStart);
printf(" %lu %lu ",ct_periodStart, t_qrStart);
print_hex(LTKey);
printf("\n");
}
else
{
......
......@@ -37,7 +37,6 @@ public class LocationSpecificPart {
public static final short LOCATION_TEMPORARY_SECRET_KEY_SIZE = 32; // 256 bits
public static final String VERSION_VALIDATION_MESSAGE = "Version should have a value between 0 and 8 (included)";
public static final String TYPE_VALIDATION_MESSAGE = "Type should have a value between 0 and 8 (included)";
public static final String COUNTRY_CODE_VALIDATION_MESSAGE = "Country code should have a value between 0 and 4096 (included)";
public static final String LOCATION_TEMPORARY_PUBLIC_ID_VALIDATION_MESSAGE = "Location temporary public Id must not be null";
public static final String QRCODE_RENEWAL_INTERVAL_VALIDATION_MESSAGE = "QR-code renewal interval exponent compact should have a value between 0 and 32 (included)";
public static final String VENUE_TYPE_VALIDATION_MESSAGE = "Venue type should have a value between 0 and 32 (included)";
......@@ -64,15 +63,6 @@ public class LocationSpecificPart {
@Max(value = 8, message = TYPE_VALIDATION_MESSAGE)
protected int type = 0;
/*
* Country code, coded as the ISO 3166-1 country code, for instance 0x250 for
* France
*/
@Builder.Default
@Min(value = 0, message = COUNTRY_CODE_VALIDATION_MESSAGE)
@Max(value = 4096, message = COUNTRY_CODE_VALIDATION_MESSAGE)
protected int countryCode = 250;
/* regular users or staff member of the location */
protected boolean staff;
......
......@@ -129,7 +129,7 @@ public class LocationSpecificPartDecoder {
/**
* Unpack the data message (binary format) :
* | Staff | pad2 |CRIexp | vType |
* vCat1 | vCat2 | countryCode | | periodDuration | ct_periodStart | t_qrStart |
* vCat1 | vCat2 | reserved | | periodDuration | ct_periodStart | t_qrStart |
* LTKey | to extract parameters
*/
public LocationSpecificPart decodeMessage(byte[] binaryLocationSpecificPart, LocationSpecificPartBuilder locationSpecificPartbuilder) {
......@@ -145,8 +145,8 @@ public class LocationSpecificPartDecoder {
locationSpecificPartbuilder
.staff(message.getNextInteger(1) == 1);
message.getNextInteger(1); // skip locationContactMessagePresent
message.getNextInteger(12); // skip reserved
locationSpecificPartbuilder
.countryCode(message.getNextInteger(12))
.qrCodeRenewalIntervalExponentCompact(message.getNextInteger(5))
.venueType(message.getNextInteger(5))
.venueCategory1(message.getNextInteger(4))
......
......@@ -87,8 +87,8 @@ public class LocationSpecificPartEncoder {
}
/**
* Encode the data message in binary format: | Staff | pad2 |CRIexp | vType |
* vCat1 | vCat2 | countryCode | | periodDuration | ct_periodStart | t_qrStart |
* Encode the data message in binary format: | Staff | locContactMsgPresent | reserved | CRIexp | vType |
* vCat1 | vCat2 | periodDuration | ct_periodStart | t_qrStart |
* LTKey |
*
* @return data message in binary format
......@@ -102,8 +102,8 @@ public class LocationSpecificPartEncoder {
message.setNextInteger(locationSpecificPart.isStaff() ? 1 : 0, 1);
/* locContactMsgPresent (1 bit) */
message.setNextInteger(locationSpecificPart.isLocationContactMessagePresent() ? 1 : 0, 1);
/* countryCode (12 bits) */
message.setNextInteger(locationSpecificPart.getCountryCode(), 12);
/* reserved (12 bits) */
message.setNextInteger(0x0, 12);
/* CRIexp (5 bits) */
message.setNextInteger(locationSpecificPart.getQrCodeRenewalIntervalExponentCompact(), 5);
/* venueType (5 bits) */
......
......@@ -3,6 +3,7 @@ package fr.inria.clea.lsp;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import fr.devnied.bitlib.BytesUtils;
import fr.inria.clea.lsp.Location.LocationBuilder;
import fr.inria.clea.lsp.exception.CleaCryptoException;
import fr.inria.clea.lsp.utils.TimeUtils;
......@@ -15,14 +16,14 @@ public class LspEncoderDecoder {
* @see README.md
*/
public static void main(String[] args) throws Exception {
final String help = "Usage: LspEncoderDecoder [gen-keys] [decode lsp64 privKey] [encode staff countryCode CRIexp venueType venueCategory1 venueCategory2 periodDuration locationPhone locationPin pubkey]";
final String help = "Usage: LspEncoderDecoder [gen-keys] [decode lsp64 privKey] [encode staff CRIexp venueType venueCategory1 venueCategory2 periodDuration locationPhone locationPin pubkey]";
if (args.length == 0) {
System.out.println(help);
System.exit(0);
}
if ("encode".equals(args[0]) && ((args.length == 14) || (args.length == 11))) {
if ("encode".equals(args[0]) && ((args.length == 13) || (args.length == 10))) {
encodeLsp(args);
} else if ("decode".equals(args[0]) && args.length == 4) {
decodeLsp(args);
......@@ -45,10 +46,11 @@ public class LspEncoderDecoder {
String manualContactTracingAuthoritySecretKey = args[3];
LocationSpecificPartDecoder lspDecoder = new LocationSpecificPartDecoder(serverAuthoritySecretKey);
LocationSpecificPart lsp = lspDecoder.decrypt(lspBase64);
String valuesToreturn = "=VALUES="+ (lsp.isStaff()? 1 : 0) + " " + lsp.getCountryCode() + " " + lsp.getQrCodeRenewalIntervalExponentCompact() + " " + lsp.getVenueType();
String valuesToreturn = "=VALUES="+ (lsp.isStaff()? 1 : 0) + " " + lsp.getQrCodeRenewalIntervalExponentCompact() + " " + lsp.getVenueType();
valuesToreturn += " " + lsp.getVenueCategory1() + " " + lsp.getVenueCategory2() + " " + lsp.getPeriodDuration() + " " + lsp.getLocationTemporaryPublicId();
valuesToreturn += " " + Integer.toUnsignedString(lsp.getCompressedPeriodStartTime()) + " " + TimeUtils.ntpTimestampFromInstant(lsp.getQrCodeValidityStartTime());
valuesToreturn += " " + BytesUtils.bytesToStringNoSpace(lsp.getLocationTemporarySecretKey()).toLowerCase();
if (lsp.isLocationContactMessagePresent()) {
LocationContactMessageEncoder contactMessageDecode = new LocationContactMessageEncoder(manualContactTracingAuthoritySecretKey);
......@@ -60,21 +62,19 @@ public class LspEncoderDecoder {
protected static void encodeLsp(String[] args) throws CleaCryptoException {
int staff = Integer.parseInt(args[1]);
int countryCode = Integer.parseInt(args[2]);
int qrCodeRenewalIntervalExponentCompact = Integer.parseInt(args[3]);
int venueType = Integer.parseInt(args[4]);
int venueCategory1 = Integer.parseInt(args[5]);
int venueCategory2 = Integer.parseInt(args[6]);
int periodDuration = Integer.parseInt(args[7]);
final String serverAuthorityPublicKey = args[8];
final String manualContactTracingAuthorityPublicKey = args[9];
final String permanentLocationSecretKey = args[10];
int qrCodeRenewalIntervalExponentCompact = Integer.parseInt(args[2]);
int venueType = Integer.parseInt(args[3]);
int venueCategory1 = Integer.parseInt(args[4]);
int venueCategory2 = Integer.parseInt(args[5]);
int periodDuration = Integer.parseInt(args[6]);
final String serverAuthorityPublicKey = args[7];
final String manualContactTracingAuthorityPublicKey = args[8];
final String permanentLocationSecretKey = args[9];
Instant periodStartTime = Instant.now().truncatedTo(ChronoUnit.HOURS);
/* Encode a LSP with location */
LocationSpecificPart lsp = LocationSpecificPart.builder()
.staff(staff == 1)
.countryCode(countryCode)
.qrCodeRenewalIntervalExponentCompact(qrCodeRenewalIntervalExponentCompact)
.venueType(venueType)
.venueCategory1(venueCategory1)
......@@ -87,10 +87,10 @@ public class LspEncoderDecoder {
.serverAuthorityPublicKey(serverAuthorityPublicKey)
.permanentLocationSecretKey(permanentLocationSecretKey);
if (args.length == 14) {
final String locationPhone = args[11];
final int locationRegion = Integer.parseInt(args[12]);
final String locationPin = args[13];
if (args.length == 13) {
final String locationPhone = args[10];
final int locationRegion = Integer.parseInt(args[11]);
final String locationPin = args[12];
locationBuilder.contact( new LocationContact(locationPhone, locationRegion, locationPin, periodStartTime));
}
......@@ -100,11 +100,13 @@ public class LspEncoderDecoder {
location.getLocationSpecificPart().setQrCodeValidityStartTime(Instant.now().truncatedTo(ChronoUnit.HOURS));
String encryptedLocationSpecificPart = location.getLocationSpecificPartEncryptedBase64();
String LTKey = BytesUtils.bytesToStringNoSpace(location.getLocationSpecificPart().getLocationTemporarySecretKey()).toLowerCase();
final String valuesToreturn = "=VALUES=" + encryptedLocationSpecificPart + " "
+ location.getLocationSpecificPart().getLocationTemporaryPublicId() + " "
+ Integer.toUnsignedString(location.getLocationSpecificPart().getCompressedPeriodStartTime()) + " "
+ TimeUtils.ntpTimestampFromInstant(location.getLocationSpecificPart().getQrCodeValidityStartTime());
+ TimeUtils.ntpTimestampFromInstant(location.getLocationSpecificPart().getQrCodeValidityStartTime()) + " "
+ LTKey ;
System.out.println(valuesToreturn);
}
......
......@@ -101,7 +101,7 @@ class LocationSpecificPartTest {
Instant periodStartTime = Instant.now().truncatedTo(ChronoUnit.HOURS);
LocationContact locationContact = new LocationContact("33800130000", 12, "012345", periodStartTime);
/* Encode a LSP with location */
LocationSpecificPart lsp = LocationSpecificPart.builder().staff(true).countryCode(33)
LocationSpecificPart lsp = LocationSpecificPart.builder().staff(true)
.qrCodeRenewalIntervalExponentCompact(2).venueType(4).venueCategory1(0).venueCategory2(0)
.periodDuration(3).build();
Location location = Location.builder().contact(locationContact).locationSpecificPart(lsp)
......@@ -127,7 +127,7 @@ class LocationSpecificPartTest {
throws CleaCryptoException {
Instant periodStartTime = Instant.now().truncatedTo(ChronoUnit.HOURS);
/* Encode a LSP with location */
LocationSpecificPart lsp = LocationSpecificPart.builder().staff(true).countryCode(33)
LocationSpecificPart lsp = LocationSpecificPart.builder().staff(true)
.qrCodeRenewalIntervalExponentCompact(2).venueType(4).venueCategory1(0).venueCategory2(0)
.periodDuration(3).build();
Location location = Location.builder().locationSpecificPart(lsp)
......@@ -172,7 +172,7 @@ class LocationSpecificPartTest {
public void testQrCodeGeneration() throws Exception {
Instant periodStartTime = Instant.now().truncatedTo(ChronoUnit.HOURS);
/* Encode the LSP */
LocationSpecificPart lsp = LocationSpecificPart.builder().staff(true).countryCode(33)
LocationSpecificPart lsp = LocationSpecificPart.builder().staff(true)
.qrCodeRenewalIntervalExponentCompact(2).venueType(4).venueCategory1(0).venueCategory2(0)
.periodDuration(3).build();
Location location = Location.builder().locationSpecificPart(lsp)
......@@ -201,15 +201,15 @@ class LocationSpecificPartTest {
*/
@ParameterizedTest
@CsvFileSource(resources = "/testLSPDecoding.csv", numLinesToSkip = 1)
public void testDecodingOfLocationSpecificPartInBase64(int staff, int countryCode, String locationTemporaryPublicID,
public void testDecodingOfLocationSpecificPartInBase64(int staff, String locationTemporaryPublicID,
int qrCodeRenewalIntervalExponentCompact, int venueType, int venueCat1, int venueCat2, int periodDuration,
int periodStartTime, long qrStartTime, String serverAuthoritySecretKey, String serverAuthorityPublicKey,
int periodStartTime, long qrStartTime, String locationTemporarySecretKey,
String serverAuthoritySecretKey, String serverAuthorityPublicKey,
String lspbase64) throws CleaEncryptionException, CleaEncodingException {
LocationSpecificPartDecoder decoder = new LocationSpecificPartDecoder(serverAuthoritySecretKey);
LocationSpecificPart lsp = decoder.decrypt(lspbase64);
assertThat(lsp.isStaff()).isEqualTo(staff == 1);
assertThat(lsp.getCountryCode()).isEqualTo(countryCode);
assertThat(lsp.getQrCodeRenewalIntervalExponentCompact()).isEqualTo(qrCodeRenewalIntervalExponentCompact);
assertThat(lsp.getLocationTemporaryPublicId()).isEqualTo(UUID.fromString(locationTemporaryPublicID));
assertThat(lsp.getPeriodDuration()).isEqualTo(periodDuration);
......@@ -217,6 +217,8 @@ class LocationSpecificPartTest {
assertThat(lsp.getVenueCategory1()).isEqualTo(venueCat1);
assertThat(lsp.getVenueCategory2()).isEqualTo(venueCat2);
assertThat(lsp.getCompressedPeriodStartTime()).isEqualTo(periodStartTime);
String lsp_locationTemporarySecretKey = BytesUtils.bytesToStringNoSpace(lsp.getLocationTemporarySecretKey()).toLowerCase();
assertThat(lsp_locationTemporarySecretKey).isEqualTo(locationTemporarySecretKey);
assertThat(lsp.getQrCodeValidityStartTime()).isEqualTo(TimeUtils.instantFromTimestamp(qrStartTime));
}
......@@ -227,10 +229,10 @@ class LocationSpecificPartTest {
*/
@ParameterizedTest
@CsvFileSource(resources = "/testLSPDecoding.csv", numLinesToSkip = 1)
public void testEncodingDecodingOfLSPSpecificPartInBase64(int staff, int countryCode,
public void testEncodingDecodingOfLSPSpecificPartInBase64(int staff,
String locationTemporaryPublicID, int qrCodeRenewalIntervalExponentCompact, int venueType, int venueCat1,
int venueCat2, int periodDuration, int periodStartTime, long qrStartTime, String serverAuthoritySecretKey,
String serverAuthorityPublicKey, String lspbase64) throws CleaCryptoException {
int venueCat2, int periodDuration, int periodStartTime, long qrStartTime, String locationTemporarySecretKey,
String serverAuthoritySecretKey, String serverAuthorityPublicKey, String lspbase64) throws CleaCryptoException {
/* Use only testLSPDecoding.csv parameters to have a variety of parameters */
/* times parameters and location are generated */
Instant myPeriodStartTime = Instant.now().truncatedTo(ChronoUnit.HOURS);
......@@ -243,7 +245,6 @@ class LocationSpecificPartTest {
/* Encode a LSP with location */
LocationSpecificPart lsp = LocationSpecificPart.builder()
.staff(staff == 1)
.countryCode(countryCode)
.qrCodeRenewalIntervalExponentCompact(qrCodeRenewalIntervalExponentCompact)
.venueType(venueType)
.venueCategory1(venueCat1)
......
......@@ -30,7 +30,6 @@ public class LocationSpecificPartValidationTest {
locationSpecificPartBuilder = LocationSpecificPart.builder()
.version(0)
.type(0)
.countryCode(250)
.staff(false)
.locationTemporaryPublicId(UUID.randomUUID())
.qrCodeRenewalIntervalExponentCompact(0)
......@@ -97,29 +96,6 @@ public class LocationSpecificPartValidationTest {
assertThat(exception.getViolations()).anyMatch(violation -> violation.getMessage().equals(LocationSpecificPart.TYPE_VALIDATION_MESSAGE));
}
@Test
public void testWhenCountryCodeHasnegativeValueThenValidationFails() {
LocationSpecificPart lsp = locationSpecificPartBuilder.countryCode(-1).build();
CleaInvalidLocationMessageException exception = assertThrows(CleaInvalidLocationMessageException.class, () -> {
this.validator.validateMessage(lsp);
});
assertThat(exception.getViolations().size()).isEqualTo(1);
assertThat(exception.getViolations()).anyMatch(violation -> violation.getMessage().equals(LocationSpecificPart.COUNTRY_CODE_VALIDATION_MESSAGE));
}
@Test
public void testWhenCountryCodeGreaterThan4096ThenValidationFails() {
LocationSpecificPart lsp = locationSpecificPartBuilder.countryCode(4097).build();
CleaInvalidLocationMessageException exception = assertThrows(CleaInvalidLocationMessageException.class, () -> {
this.validator.validateMessage(lsp);
});
assertThat(exception.getViolations().size()).isEqualTo(1);
assertThat(exception.getViolations()).anyMatch(violation -> violation.getMessage().equals(LocationSpecificPart.COUNTRY_CODE_VALIDATION_MESSAGE));
}
@Test
public void testWhenLocationTemporaryPublicIdIsIsNullThenValidationFails() {
......
......@@ -108,7 +108,7 @@ public class LocationTest {
protected LocationSpecificPart newLocationSpecificPart(int qrCodeRenewalIntervalExponentCompact,
int periodDuration) {
return LocationSpecificPart.builder().staff(true).countryCode(33)
return LocationSpecificPart.builder().staff(true)
.qrCodeRenewalIntervalExponentCompact(qrCodeRenewalIntervalExponentCompact).venueType(4)
.venueCategory1(0).venueCategory2(0).periodDuration(periodDuration).build();
}
......
staff, countryCode, LTId, CRIexp, venueType, venueCat1, venueCat2, periodDuration, ct_periodStart, t_qrStart, SK_SA, PK_SA, lsp_base64
0, 492, c5f2d008-5665-83cb-c96f-4ae18aad1dfd, 5, 12, 0, 0, 3, 1062909, 3826472280, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, AMXy0AhWZYPLyW9K4YqtHf12w-Q5VvP2R6ZtCT4WlfLAWeVFSBadzFeGINFc4NNWSX7E6boxRNMeDotD7LBahTSfMhULz9GhGhTyV-uMIcB9nW0VRaWNgzbw4kvWXw-sOl3fZpLOmNwDADaznmr89IK5IOq0vKJlczwnYxb3ZBqWPqKC5bnw5kbLh-7cagJbAszeSxi-P0YcqK9hzEK9WYj2CJJzjWdmZOor61j5Rw==
1, 4095, c5f2d008-5665-83cb-c96f-4ae18aad1dfd, 31, 31, 15, 15, 255, 1062909, 3826472280, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, AMXy0AhWZYPLyW9K4YqtHf0p_Gysu2EU0qEyzx-nrs5_vbp9FGCpNRhOrrzW_aXwKL8AQlgJBeZLQBGZ2hr0N2xNnljVBLBSgJw8wGyuIptqlWejsFtKMQwq4RpcuS7xybb6nQx0KuAssACnjrNRhQl3J_t7LBt4sqjtEK1LDOc222qPEZtnXmkqfNTWPgOTqZUuojJvfeTmTtrQDKDO5TJOJSB-4iGgn2gWLP6NjA==
1, 592, c5f2d008-5665-83cb-c96f-4ae18aad1dfd, 31, 31, 15, 15, 255, 1062909, 3826472280, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AMXy0AhWZYPLyW9K4YqtHf1tPTudQD5y3C1ivD2grKgU5aX9ua7P3PH_ep3_WspttoYv50zGNao3FLrOvPKCCzwpaL6Xhm0NqQ5271kDqqtYaXzOT0EluITXgwafaRaCtRrUJdIEHDbR8ETX-PQ=
0, 492, c5f2d008-5665-83cb-c96f-4ae18aad1dfd, 5, 10, 3, 3, 5, 1062909, 3826472280, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, AMXy0AhWZYPLyW9K4YqtHf2tCYHJavT2eNYgBdmsbbqZAdysmcMhNZGnZA7pqCccjjRKSgK4sHwIMDGkJuWgGIhVf3ez1nJTJddyYrFJKPIci9_7cOGko0K1kOKj7ga7cWmuPcDqNy48xLItaG3N5KS8Mz10wdgRPT0ZEpDZd_0OdTUDoCYngBoCTVVBxQNa_B1wNgCVUYJBCjjN2gSedl2WjaoFy1MuDtUBWiAnsQ==
1, 202, c5f2d008-5665-83cb-c96f-4ae18aad1dfd, 5, 31, 3, 1, 10, 1062909, 3826472280, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, AMXy0AhWZYPLyW9K4YqtHf1wwQvjxqmRyYKBxus-eO__jQ58vPCngxSOLNibRMUi1plMNvgAVTaTaemtfDXOvz2V6TJfDfki7NjljX7ZK8LXUTppZahXTaUF864IiFwWPhmPtF1Hs3sf8Kz_qh-Ihs63RcYZwnuQ6rY--_yjZ8F0GiCwA02nZeNHdYyuZAOOqVTFXnFfMauT1896iglj0CV8-JsmbGN_dEDeJaCDAw==
0, 492, 236f860c-7a25-36f7-8fae-f0fbc81fbeae, 5, 12, 0, 0, 3, 1062908, 3826468800, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, ACNvhgx6JTb3j67w-8gfvq669YklPkwn65PWlv8rmvD4U-w99c5CC4cfUl7sXMk3MX7UYLXI1S_zR4PY3n0BQNe67f-YXnrLjqUw7MHHOSqewlvwR0FeIGBxLGkeTpBr0KAKDBLPgP5P6VV4SKnVmv-A7GoJCk_vB5Rm44FhklTX2Z0NRfP25zjIndtCYgK4UquFC-gRD2bmgESkNCrm1V6g7o64fdjpX8kULwSK0A==
1, 4095, 236f860c-7a25-36f7-8fae-f0fbc81fbeae, 31, 31, 15, 15, 255, 1062908, 3826468800, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, ACNvhgx6JTb3j67w-8gfvq7Neda9SHsIggs7FlrhvBf26kDkGwdcbTtcPbyvLejUjFhR2giEeokPPOM8_-j9F8p4FnZndNo5Lsytm-YDc7eU_t3dQwK9bU6tsmjbFEPLA2XNP2bT2vgDzeYYMVVjRRirGEb4JN6WFwlF7JmkpNvY66RUfMNOoEcdN_J28wK8KjU5bmEX3ajdE6zEo0yiw6PTUlTpqV2Csd4H1Pd7uw==
1, 592, 236f860c-7a25-36f7-8fae-f0fbc81fbeae, 31, 31, 15, 15, 255, 1062908, 3826468800, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ACNvhgx6JTb3j67w-8gfvq6Um04rhVunQBLoiF1yOYjSEDw0_tV6cW8Azke9LB4TMUHXrufg1hwGkaoWr9o9XFr6agQxJDO6IW5WUAMCtePZzuLlFQlV6GMKhhtwBDaITmBNQZ25KKH9TWKo2lQ=
0, 492, 236f860c-7a25-36f7-8fae-f0fbc81fbeae, 5, 10, 3, 3, 5, 1062908, 3826468800, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, ACNvhgx6JTb3j67w-8gfvq4e7MYZwNZLmW94RbzrcNJxipSBsoL1GcUl0bb4Asm4trtXHRAQUaq8T0m1yQDvM_FmWa0UW1-fRLwQQrWJjNb7fpg2NcZ5a-QL3iyrFFmhDgwxBJsxcNwf5RUVYphUa-y8Tf_0fXn6T37BPJjTW-4w4MVQQJ9m_ELWjAwjEgPWyv1VUmrTdg-4QKWiU_vdrmz9__XXWz1WWuaV8aIKLg==
1, 202, 236f860c-7a25-36f7-8fae-f0fbc81fbeae, 5, 31, 3, 1, 10, 1062908, 3826468800, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, ACNvhgx6JTb3j67w-8gfvq60HlOOZWvwbluQ5BsbkQdTsP-EfjkwR1lY7q6yaVoqeVUHkoUIPm0EAq8JvQHKlidB1h5Nrd55eAIopIWnrpHazjDC3IlOR2OkT88g5cQDosFeX3PBNMdVLYLpyP9bbNN1ivWzNgK4WD3oEv3PrE8ZdMYQyPyjsOXDt3AfpgIEiVoDZ4zpeYlib5z6exCV56NxI4JSxvUp9wPlhSFSVg==
staff, LTId, CRIexp, venueType, venueCat1, venueCat2, periodDuration, ct_periodStart, t_qrStart, LTKey, SK_SA, PK_SA, lsp_base64
0, 752cf111-bf98-8a11-c403-1ed0fe0790f1, 5, 12, 0, 0, 3, 1063143, 3827314380, f4ac94549068cfdcb2a071dc49ad63e7acca8786204fb90d2e80685582f4f5d6, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, AHUs8RG_mIoRxAMe0P4HkPECFz4EBvSjNNgHa2uyOppCfMETmZjLlAglrFyz98ml7GLc2uRfr10oPjV5plbsdu-YDXq7hf6D7CFUKeAeDyc7bIkCsgBbbksvqsbYnTMTTsUYdO-NvFOQXYpHjijLY2Pt-q7Erw-RV-r0BQnJYJi62LiZnbNO5XgFAPzn5wP4RMjigfoLVzZilqOd-3gFUqQWDbSCq4m0nGY0SOsp7Q==
1, 752cf111-bf98-8a11-c403-1ed0fe0790f1, 31, 31, 15, 15, 255, 1063143, 3827314380, f4ac94549068cfdcb2a071dc49ad63e7acca8786204fb90d2e80685582f4f5d6, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, AHUs8RG_mIoRxAMe0P4HkPFkvrpvj3rk-NHLqb19HZb31epwPoaEWaK8tnI1vvPi8rRxh0eQOTpSp4V2l7qwyRJWnzrrwE391OzyEGH-Og379Or0WVr8PT9gfsdhiv_VxJ3cd7au-LgZP1A7IHlQrEL3rgJAD-dWIV9ydQT9UqYR5-y6j1sIj_4ij95tqAMVpPHge_4nOsI1ret0xvHsBn4hjr8v9WWmf5U4rn_wgA==
1, 752cf111-bf98-8a11-c403-1ed0fe0790f1, 31, 31, 15, 15, 255, 1063143, 3827314380, f4ac94549068cfdcb2a071dc49ad63e7acca8786204fb90d2e80685582f4f5d6, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AHUs8RG_mIoRxAMe0P4HkPHyclaFICuuvhq2JIKzQZzoiXQbSh1zyDaJk4_yr7VWcmHn6GQ492a03ojxGOL_o86rcmHHICl8jMTKBlYChEv52Ky_0u6BoAPOCVgIuOfhJcAKCKzJBGG6uvjZYR4=
0, 752cf111-bf98-8a11-c403-1ed0fe0790f1, 5, 10, 3, 3, 5, 1063143, 3827314380, f4ac94549068cfdcb2a071dc49ad63e7acca8786204fb90d2e80685582f4f5d6, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, AHUs8RG_mIoRxAMe0P4HkPHh6YxTkEqiG5b1OCT95jwnOBjIqk9uw-wwclaBBJQpfK_AF627JRRkvKi-jXCJhEdh0SrUzz7pq5_Q4AN2jJhzXZBg5EYwjsJ-e8oPuiITuR7dl3MIcGKOnsoE8ZAgB0WYtEnzIfliaKt7nn10yGKbTKHoUBgLfgB8U1YmXANIb8seOOCztqid_qOPp2BqtWSczt9XhM1AAHmP58rl4w==
1, 752cf111-bf98-8a11-c403-1ed0fe0790f1, 5, 31, 3, 1, 10, 1063143, 3827314380, f4ac94549068cfdcb2a071dc49ad63e7acca8786204fb90d2e80685582f4f5d6, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, AHUs8RG_mIoRxAMe0P4HkPEkCDCBdXLuAOuFMJw4ZwnAjCJAwfQK6cXy89BMN2PPfN63YaAULsy7LILYtkGtLintzA7kwEhGHwRfOCnXM1XZaLnquVl3XdJ47wKoX52QJyL82iKh5fiNpFUcMqvIO8jtLQwTwFanPFDBUBWaIHX2mdtY6gO97iwChRQp1wPiKjb61p376VgqKt4JIjK3O1k_PwnLr-asXuY5CkHSZw==
0, e3baa3ab-eb07-3d89-b78e-c9744a2f2c94, 5, 12, 0, 0, 3, 1063142, 3827311200, 00a9e6c03fbf6d523bf3a107d7f92b90a7ea2dda4f0c600d0bf788b1b4803ef1, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, AOO6o6vrBz2Jt47JdEovLJRIahZO-f9VdaNOcqlBrSggHNDPUb7tQ-US3mfslvxpcrw2nXXMbONs84MnvbkCDJvM-UW0ExHkZ2E-cfzpk2bbJJl1HOrUudq1DCTawOFGohH8ylErxos_J0xw606IRGZSpYl0JCHeJLsnGAiWAllhmE4Im-wzpqGlg-p8igLPpwRHnv9TF99ip89CPnXq8jDz7Aw_CSSQM3CsEDCu9A==
1, e3baa3ab-eb07-3d89-b78e-c9744a2f2c94, 31, 31, 15, 15, 255, 1063142, 3827311200, 00a9e6c03fbf6d523bf3a107d7f92b90a7ea2dda4f0c600d0bf788b1b4803ef1, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, AOO6o6vrBz2Jt47JdEovLJQY3mKy48JWJLpGM5RCcPjdSQZ-vEnNz0J056p1r-yIilQg32PjF6UShs-KI8e9FsZJarzIHGS1z1Rk9kKabWoFQ-Hk_AI3TD-kVEBMkPVi5tVpMjyjsdGTq_58FDyoSyKfiRvQI6Di-9APQfH--ZRrohCfgCPiuYsKe6vbdQPyzKWmLLF1X6W-5d7Qk0-zzkbLp3u2fH-L7qBtswmWhA==
1, e3baa3ab-eb07-3d89-b78e-c9744a2f2c94, 31, 31, 15, 15, 255, 1063142, 3827311200, 00a9e6c03fbf6d523bf3a107d7f92b90a7ea2dda4f0c600d0bf788b1b4803ef1, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AOO6o6vrBz2Jt47JdEovLJQQeh4d8fhXELncLYvzmHt0Vv59KvOTo7Xgle6nU-PgC9Yc5-Wuw6pBa_GJVja4iiVIdsi5jtPocuSvmPUDoNpABcRuycrPx4C5pUi1NH8dAYAZXk7gvIF8sUpbBho=
0, e3baa3ab-eb07-3d89-b78e-c9744a2f2c94, 5, 10, 3, 3, 5, 1063142, 3827311200, 00a9e6c03fbf6d523bf3a107d7f92b90a7ea2dda4f0c600d0bf788b1b4803ef1, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, AOO6o6vrBz2Jt47JdEovLJRMrtQSHtdIw4SWwjpZwgaaP0hss3e7tb1o1K91trODOtgJr8sH_MqP3l41KqPiTKD3uL45qafgFDRDJd12x5vTDNYX4jfknjJk5gZcwIz6-8pivqGoZNCZCxsQWf6jU5ABy0UqkkMRhBQUiAVvWZhpyP_vAcyvDvAXcYSRhQNEhzcT0h8R5h7oYQ__kmsyyrANYpQIjAPG0dphWyh9iw==
1, e3baa3ab-eb07-3d89-b78e-c9744a2f2c94, 5, 31, 3, 1, 10, 1063142, 3827311200, 00a9e6c03fbf6d523bf3a107d7f92b90a7ea2dda4f0c600d0bf788b1b4803ef1, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, AOO6o6vrBz2Jt47JdEovLJRObq-OEyPnRRSZaitQqH_IlvGvnQ6OpVmGlpiEEc8ww2ZPoZ_9iPXlxCfOuK6jkZB4YyEoL787Uwvmt20f6fYovxhuAR83Dzu4CEOoaDYyUaJF3pt74zwF4yels2k-sv01MKTsRvmc-42SUQV7zE7E0OKjU1hyNixUTmh3nwPWFZ39RLamBX14cTxjrtqgwisPsBSX2NA5f9Oi02u-eA==
locationPhone, locationRegion, locationPin, t_periodStart, SK_SA, PK_SA, SK_MCTA, PK_MCTA, lsp_base64
3380013000, 1, 012345, 3826472400, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AMXy0AhWZYPLyW9K4YqtHf12w-Q5VvP2R6ZtCT4WlfLAWeVFSBadzFeGINFc4NNWSX7E6boxRNMeDotD7LBahTSfMhULz9GhGhTyV-uMIcB9nW0VRaWNgzbw4kvWXw-sOl3fZpLOmNwDADaznmr89IK5IOq0vKJlczwnYxb3ZBqWPqKC5bnw5kbLh-7cagJbAszeSxi-P0YcqK9hzEK9WYj2CJJzjWdmZOor61j5Rw==
001122334455667, 255, 012345, 3826472400, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AMXy0AhWZYPLyW9K4YqtHf0p_Gysu2EU0qEyzx-nrs5_vbp9FGCpNRhOrrzW_aXwKL8AQlgJBeZLQBGZ2hr0N2xNnljVBLBSgJw8wGyuIptqlWejsFtKMQwq4RpcuS7xybb6nQx0KuAssACnjrNRhQl3J_t7LBt4sqjtEK1LDOc222qPEZtnXmkqfNTWPgOTqZUuojJvfeTmTtrQDKDO5TJOJSB-4iGgn2gWLP6NjA==
33800130000, 21, 012345, 3826472400, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AMXy0AhWZYPLyW9K4YqtHf2tCYHJavT2eNYgBdmsbbqZAdysmcMhNZGnZA7pqCccjjRKSgK4sHwIMDGkJuWgGIhVf3ez1nJTJddyYrFJKPIci9_7cOGko0K1kOKj7ga7cWmuPcDqNy48xLItaG3N5KS8Mz10wdgRPT0ZEpDZd_0OdTUDoCYngBoCTVVBxQNa_B1wNgCVUYJBCjjN2gSedl2WjaoFy1MuDtUBWiAnsQ==
33800130000, 12, 543210, 3826472400, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AMXy0AhWZYPLyW9K4YqtHf1wwQvjxqmRyYKBxus-eO__jQ58vPCngxSOLNibRMUi1plMNvgAVTaTaemtfDXOvz2V6TJfDfki7NjljX7ZK8LXUTppZahXTaUF864IiFwWPhmPtF1Hs3sf8Kz_qh-Ihs63RcYZwnuQ6rY--_yjZ8F0GiCwA02nZeNHdYyuZAOOqVTFXnFfMauT1896iglj0CV8-JsmbGN_dEDeJaCDAw==
3380013000, 1, 012345, 3826468800, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ACNvhgx6JTb3j67w-8gfvq669YklPkwn65PWlv8rmvD4U-w99c5CC4cfUl7sXMk3MX7UYLXI1S_zR4PY3n0BQNe67f-YXnrLjqUw7MHHOSqewlvwR0FeIGBxLGkeTpBr0KAKDBLPgP5P6VV4SKnVmv-A7GoJCk_vB5Rm44FhklTX2Z0NRfP25zjIndtCYgK4UquFC-gRD2bmgESkNCrm1V6g7o64fdjpX8kULwSK0A==
001122334455667, 255, 012345, 3826468800, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ACNvhgx6JTb3j67w-8gfvq7Neda9SHsIggs7FlrhvBf26kDkGwdcbTtcPbyvLejUjFhR2giEeokPPOM8_-j9F8p4FnZndNo5Lsytm-YDc7eU_t3dQwK9bU6tsmjbFEPLA2XNP2bT2vgDzeYYMVVjRRirGEb4JN6WFwlF7JmkpNvY66RUfMNOoEcdN_J28wK8KjU5bmEX3ajdE6zEo0yiw6PTUlTpqV2Csd4H1Pd7uw==
33800130000, 21, 012345, 3826468800, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ACNvhgx6JTb3j67w-8gfvq4e7MYZwNZLmW94RbzrcNJxipSBsoL1GcUl0bb4Asm4trtXHRAQUaq8T0m1yQDvM_FmWa0UW1-fRLwQQrWJjNb7fpg2NcZ5a-QL3iyrFFmhDgwxBJsxcNwf5RUVYphUa-y8Tf_0fXn6T37BPJjTW-4w4MVQQJ9m_ELWjAwjEgPWyv1VUmrTdg-4QKWiU_vdrmz9__XXWz1WWuaV8aIKLg==
33800130000, 12, 543210, 3826468800, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ACNvhgx6JTb3j67w-8gfvq60HlOOZWvwbluQ5BsbkQdTsP-EfjkwR1lY7q6yaVoqeVUHkoUIPm0EAq8JvQHKlidB1h5Nrd55eAIopIWnrpHazjDC3IlOR2OkT88g5cQDosFeX3PBNMdVLYLpyP9bbNN1ivWzNgK4WD3oEv3PrE8ZdMYQyPyjsOXDt3AfpgIEiVoDZ4zpeYlib5z6exCV56NxI4JSxvUp9wPlhSFSVg==
3380013000, 1, 012345, 3827314800, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AHUs8RG_mIoRxAMe0P4HkPECFz4EBvSjNNgHa2uyOppCfMETmZjLlAglrFyz98ml7GLc2uRfr10oPjV5plbsdu-YDXq7hf6D7CFUKeAeDyc7bIkCsgBbbksvqsbYnTMTTsUYdO-NvFOQXYpHjijLY2Pt-q7Erw-RV-r0BQnJYJi62LiZnbNO5XgFAPzn5wP4RMjigfoLVzZilqOd-3gFUqQWDbSCq4m0nGY0SOsp7Q==
001122334455667, 255, 012345, 3827314800, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AHUs8RG_mIoRxAMe0P4HkPFkvrpvj3rk-NHLqb19HZb31epwPoaEWaK8tnI1vvPi8rRxh0eQOTpSp4V2l7qwyRJWnzrrwE391OzyEGH-Og379Or0WVr8PT9gfsdhiv_VxJ3cd7au-LgZP1A7IHlQrEL3rgJAD-dWIV9ydQT9UqYR5-y6j1sIj_4ij95tqAMVpPHge_4nOsI1ret0xvHsBn4hjr8v9WWmf5U4rn_wgA==
33800130000, 21, 012345, 3827314800, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AHUs8RG_mIoRxAMe0P4HkPHh6YxTkEqiG5b1OCT95jwnOBjIqk9uw-wwclaBBJQpfK_AF627JRRkvKi-jXCJhEdh0SrUzz7pq5_Q4AN2jJhzXZBg5EYwjsJ-e8oPuiITuR7dl3MIcGKOnsoE8ZAgB0WYtEnzIfliaKt7nn10yGKbTKHoUBgLfgB8U1YmXANIb8seOOCztqid_qOPp2BqtWSczt9XhM1AAHmP58rl4w==
33800130000, 12, 543210, 3827314800, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AHUs8RG_mIoRxAMe0P4HkPEkCDCBdXLuAOuFMJw4ZwnAjCJAwfQK6cXy89BMN2PPfN63YaAULsy7LILYtkGtLintzA7kwEhGHwRfOCnXM1XZaLnquVl3XdJ47wKoX52QJyL82iKh5fiNpFUcMqvIO8jtLQwTwFanPFDBUBWaIHX2mdtY6gO97iwChRQp1wPiKjb61p376VgqKt4JIjK3O1k_PwnLr-asXuY5CkHSZw==
3380013000, 1, 012345, 3827311200, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AOO6o6vrBz2Jt47JdEovLJRIahZO-f9VdaNOcqlBrSggHNDPUb7tQ-US3mfslvxpcrw2nXXMbONs84MnvbkCDJvM-UW0ExHkZ2E-cfzpk2bbJJl1HOrUudq1DCTawOFGohH8ylErxos_J0xw606IRGZSpYl0JCHeJLsnGAiWAllhmE4Im-wzpqGlg-p8igLPpwRHnv9TF99ip89CPnXq8jDz7Aw_CSSQM3CsEDCu9A==
001122334455667, 255, 012345, 3827311200, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AOO6o6vrBz2Jt47JdEovLJQY3mKy48JWJLpGM5RCcPjdSQZ-vEnNz0J056p1r-yIilQg32PjF6UShs-KI8e9FsZJarzIHGS1z1Rk9kKabWoFQ-Hk_AI3TD-kVEBMkPVi5tVpMjyjsdGTq_58FDyoSyKfiRvQI6Di-9APQfH--ZRrohCfgCPiuYsKe6vbdQPyzKWmLLF1X6W-5d7Qk0-zzkbLp3u2fH-L7qBtswmWhA==
33800130000, 21, 012345, 3827311200, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AOO6o6vrBz2Jt47JdEovLJRMrtQSHtdIw4SWwjpZwgaaP0hss3e7tb1o1K91trODOtgJr8sH_MqP3l41KqPiTKD3uL45qafgFDRDJd12x5vTDNYX4jfknjJk5gZcwIz6-8pivqGoZNCZCxsQWf6jU5ABy0UqkkMRhBQUiAVvWZhpyP_vAcyvDvAXcYSRhQNEhzcT0h8R5h7oYQ__kmsyyrANYpQIjAPG0dphWyh9iw==
33800130000, 12, 543210, 3827311200, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, AOO6o6vrBz2Jt47JdEovLJRObq-OEyPnRRSZaitQqH_IlvGvnQ6OpVmGlpiEEc8ww2ZPoZ_9iPXlxCfOuK6jkZB4YyEoL787Uwvmt20f6fYovxhuAR83Dzu4CEOoaDYyUaJF3pt74zwF4yels2k-sv01MKTsRvmc-42SUQV7zE7E0OKjU1hyNixUTmh3nwPWFZ39RLamBX14cTxjrtqgwisPsBSX2NA5f9Oi02u-eA==
......@@ -71,18 +71,6 @@
<option value="4">C25</option>
</select>
</div>
<div>
<label for="countryCode">Country code:</label>
<select id="countryCode">
<option value="056">Belgium</option>
<option value="250">France</option>
<option value="274">Germany</option>
<option value="380">Italy</option>
<option value="724">Spain</option>
<option value="826">United Kindom of Great Britain and Northern Ireland</option>
<option value="840">United States of America</option>
</select>
</div>
<div>
<label for="periodDuration">Period duration (in h):</label>
<input type="number" id="periodDuration" name="periodDuration" required min=0 max=255
......
<
......@@ -26,7 +26,7 @@ let verbose = false;
* @param {conf} config user configuration
* conf = {SK_L, PK_SA, PK_MCTA,
* staff, CRIexp, venueType, venueCategory1, venueCategory2,
* countryCode, periodDuration, locContactMsg}
* periodDuration, locContactMsg}
*
* @return
*/
......@@ -66,7 +66,7 @@ export async function cleaStartNewPeriod(config) {
* @param {conf} config user configuration
* conf = {SK_L, PK_SA, PK_MCTA,
* staff, CRIexp, venueType, venueCategory1, venueCategory2,
* countryCode, periodDuration, locContactMsg}
* periodDuration, locContactMsg}
*
* @return {string} encoded LSP in Base64 format
*/
......@@ -88,8 +88,9 @@ export async function cleaRenewLSP(config) {
header.set(gConf.LTId, 1);
// Fill message
msg[0] = ((config.staff & 0x1) << 7) | (config.locContactMsg ? 0x40 : 0) | ((config.countryCode & 0xFC0) >>> 6);
msg[1] = ((config.countryCode & 0x3F) << 2) | ((config.CRIexp & 0x18) >> 3);
let reserved = 0x0; // reserved for specification evolution
msg[0] = ((config.staff & 0x1) << 7) | (config.locContactMsg ? 0x40 : 0) | ((reserved & 0xFC0) >>> 6);
msg[1] = ((reserved & 0x3F) << 2) | ((config.CRIexp & 0x18) >> 3);
msg[2] = ((config.CRIexp & 0x7) << 5) | (config.venueType & 0x1F);
msg[3] = ((config.venueCategory1 & 0xF) << 4) | (config.venueCategory2 & 0xF);
msg[4] = config.periodDuration;
......@@ -100,7 +101,7 @@ export async function cleaRenewLSP(config) {