Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 9a7915ef authored by Baobab Tac's avatar Baobab Tac
Browse files

Changed Base64 to Base64Url

parent b99d82af
Pipeline #233202 failed with stages
in 4 minutes and 38 seconds
......@@ -164,7 +164,7 @@ static void compute_TLKey(void)
*/
static void to_base64(uint8_t *in, uint8_t *out, uint8_t n)
{
static const uint8_t base64_table[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static const uint8_t base64_table[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
uint8_t *pos;
const uint8_t *end, *start;
......
......@@ -75,7 +75,7 @@ public class Location {
* @throws CleaEncryptionException
*/
public String getLocationSpecificPartEncryptedBase64() throws CleaCryptoException {
return Base64.getEncoder().encodeToString(this.getLocationSpecificPartEncrypted());
return Base64.getUrlEncoder().encodeToString(this.getLocationSpecificPartEncrypted());
}
protected byte[] getLocationSpecificPartEncrypted() throws CleaCryptoException {
......
......@@ -80,7 +80,7 @@ public class LocationSpecificPartDecoder {
* @throws CleaEncodingException
*/
public LocationSpecificPart decrypt(String lspBase64) throws CleaEncryptionException, CleaEncodingException {
byte[] encryptedLocationSpecificPart = Base64.getDecoder().decode(lspBase64);
byte[] encryptedLocationSpecificPart = Base64.getUrlDecoder().decode(lspBase64);
log.debug("Base 64 decoded LSP: {}", encryptedLocationSpecificPart);
return this.decrypt(encryptedLocationSpecificPart);
}
......
......@@ -302,7 +302,7 @@ class LocationSpecificPartTest {
/* EC private key from C package */
final String privateKey = "3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd";
/* message encrypted, from C package */
final String cipherTextBase64 = "AHHp6U8wrVQuWDomdZfDS0BHC45n72pzlmAhqE7AZp3hTWt2cuUOJ78nNeZSJCrpjpl3glMI49yjLEoIi73wqsSbja1sMH0XzuNoAssCV53wTItE3Nxg+J3FI78/W6uWD8IU+dn0YEroJwH2y1g=";
final String cipherTextBase64 = "AHHp6U8wrVQuWDomdZfDS0BHC45n72pzlmAhqE7AZp3hTWt2cuUOJ78nNeZSJCrpjpl3glMI49yjLEoIi73wqsSbja1sMH0XzuNoAssCV53wTItE3Nxg-J3FI78_W6uWD8IU-dn0YEroJwH2y1g=";
/* plain text message byte array */
byte[] plainTextBytes = { (byte) 0x00, (byte) 0x71, (byte) 0xE9, (byte) 0xE9, (byte) 0x4F, (byte) 0x30,
(byte) 0xAD, (byte) 0x54, (byte) 0x2E, (byte) 0x58, (byte) 0x3A, (byte) 0x26, (byte) 0x75, (byte) 0x97,
......
staff, countryCode, LTId, CRIexp, venueType, venueCat1, venueCat2, periodDuration, ct_periodStart, t_qrStart, SK_SA, PK_SA, lsp_base64
0, 492, 33de6154-4d97-fa2a-67b7-ee6ead2ba50f, 5, 12, 0, 0, 3, 1062861, 3826300545, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, ADPeYVRNl/oqZ7fubq0rpQ+tpUVK3hjbg0ppQcAlOtIF5q+2VE0xY/tqFpLnsx+0XW4GFIRemr9iM3ePapOznbaauRp74OgR2zttSDHXBbX5tZbJwfMmNGZ4xnps93s6l3480UKjOj5BDilX9mY6+ndzCzYaTbBgK6aiqbg5yJn6euEjBaBNPJI9S+eGsQLcFRgwdM9vVjf/rgAo+HIKeWgRRuNRlkuYMPpi+HeBZA==
1, 4095, 33de6154-4d97-fa2a-67b7-ee6ead2ba50f, 31, 31, 15, 15, 255, 1062861, 3826300545, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, ADPeYVRNl/oqZ7fubq0rpQ/9F0A5amZjz7/mfh8fsnvbXvXd/SXiBYgYHKC68u7t9hsNZQ237vKzgDVNrA8crcyt7OzY/wB2Vrom5zrcgh4cl1QR94LU2S8jRLcC5gl9wgp/bkFVMhHGj/HnbuRTuS8kwo5xJAUf0f3FTTh5QUEUq27upYsz32kCqFVnzAKm7wH2rju1VgXxstfozLGy7MeEehz7Hw4VFMCyKAzIBA==
1, 592, 33de6154-4d97-fa2a-67b7-ee6ead2ba50f, 31, 31, 15, 15, 255, 1062861, 3826300545, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ADPeYVRNl/oqZ7fubq0rpQ9OyDkiotegiD9nJoNf8RZKt4e8WeEpSZllfy0bOh+QwjiF8M6uAj6tytJaPlqhnSZYh6hAgDq3OAQ7BIwC6eCC9xNjH4IqCZA8X59hIjVoV/1vlEAU5i+JiQIGQ6M=
0, 492, 33de6154-4d97-fa2a-67b7-ee6ead2ba50f, 5, 10, 3, 3, 5, 1062861, 3826300545, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, ADPeYVRNl/oqZ7fubq0rpQ9MwAB/ix5cJZC9et6AOBKhBxe4qBQUD8jYD1N3baMJnJtc8fkfHEuBoKoZNgfnnDU/Oka2EIQiTEfsyTWMHd0d7ZXDWoZMqmYMygZU5TW/XXbgH6JdtMChOfoGHEL5aLCPyz9B0Jwvxxg0/KwTze/V6w6fKLunx0mifl3lPgNAo2qrjXHP3EnlrnFPJ73nZzmnDzMp8Uq5ZrawH976ag==
1, 202, 33de6154-4d97-fa2a-67b7-ee6ead2ba50f, 5, 31, 3, 1, 10, 1062861, 3826300545, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, ADPeYVRNl/oqZ7fubq0rpQ9BoYGN0nV+w7qkSQLc9+THqUYEii3XruWAuF4b2KYlL2ltYCO3+ZeoKpFPclSAXGKz9zKAIDrQ0lXETSIcXcFUq5MqtKGpTe7d9uR7c6AnFhPZeoRyOWV/9uY6o3nqNzVEq0mUCVK3d6dxPKdcoAYDiUTlL0m39YI205i4zAIVnQZPoSiXoaDgfCkZhhdZpwqqHwOqPbs1pOVv6tvgVQ==
0, 492, d5e7c7bb-39c1-5d05-d099-4af94c5e1508, 5, 12, 0, 0, 3, 1062551, 3825183806, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, ANXnx7s5wV0F0JlK-UxeFQhit4IeKD9oDNEJ3ICWC2r-V9-3lmivN0ASWJ2LY4J7JGhBe7no034i84J0sJAxgc7X_k_pRculBiPHXGi30bw2r-iXRZNQXLWsuNdO3Xz_wRbALxE_WEUyjXK1wPpwQK6gIqRN0wCen6UdKqjMm8RT_jPlQ4HC53WmDWtElwKG1cwMV8IvTqlKWHUB4S4JTHMwZuHeLkDq8M8-O2uodA==
1, 4095, d5e7c7bb-39c1-5d05-d099-4af94c5e1508, 31, 31, 15, 15, 255, 1062551, 3825183806, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, ANXnx7s5wV0F0JlK-UxeFQh4pkn9iw5HsbDWFhRGr_AMgxyDtCeFDNdcLDezLMKNXq-xWK6cZuTvsrRLF1t7rFl7kFxXMIJ385crApGR9dcSCudfurY_qyejYYPC8lXL5-RMZwmeJgiIbjditviTn5OJY2NB2Ppy_EMhKUfnyB9Z69Mu1K8zcFQ0upJwZQOqMaRnoi3B7bEy_YB1_a3zTBDfUUx2usoxeddLFxe0yw==
1, 592, d5e7c7bb-39c1-5d05-d099-4af94c5e1508, 31, 31, 15, 15, 255, 1062551, 3825183806, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ANXnx7s5wV0F0JlK-UxeFQgV9xGX_BNF8V7w8HYosVwROBC7hGPHtLsLtgNi8-AoSFlizStzODCWAG1RYxLvzdsqeBg16xuDmJPSuAwC8oLHWqgxzdlvBNCVj2DcZY7QDsutVwJLnR_mZRefSwc=
0, 492, d5e7c7bb-39c1-5d05-d099-4af94c5e1508, 5, 10, 3, 3, 5, 1062551, 3825183806, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, ANXnx7s5wV0F0JlK-UxeFQgVgfG98RQuDK0XKoD66X1m7sPtoqN-quHevsBQQYb0PdoTgJqFhK5d0ffWOVNOntfPHMckUnpoqraUOav4wYCjjhF39ZImldJgT6awp4PLDfglg5JqynANkg-0aFmmow61_NFw4nGlbEnoepMtRkxGmDZ9gxB-fUGZLt1yUgOdKzMy2CHuBwVu6XluiCMfbit-t2EsHUo2cO6o1aiIYg==
1, 202, d5e7c7bb-39c1-5d05-d099-4af94c5e1508, 5, 31, 3, 1, 10, 1062551, 3825183806, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, ANXnx7s5wV0F0JlK-UxeFQgjNbDa0UL0MlRp6PsAMJj_w32hx3y_VuysjaCYlraWJyst-YvqPjvoD2ebZMHdInWhWeQvYLxnqfaIG5Xu-LuXNNoXPxM7MsACQd00UUgrsqGcfRQMhO9-QbK6UJgXTcNtVdNKleqcZsXkDg3nrI_j6OIOrtccYaEhVGZlVwKiassL5jyiOrW8aDbWW1NRI1vAcdLpAR2YpZ548zW2NQ==
locationPhone, locationRegion, locationPin, t_periodStart, SK_SA, PK_SA, SK_MCTA, PK_MCTA, lsp_base64
3380013000, 1, 012345, 3826299600, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ADPeYVRNl/oqZ7fubq0rpQ+tpUVK3hjbg0ppQcAlOtIF5q+2VE0xY/tqFpLnsx+0XW4GFIRemr9iM3ePapOznbaauRp74OgR2zttSDHXBbX5tZbJwfMmNGZ4xnps93s6l3480UKjOj5BDilX9mY6+ndzCzYaTbBgK6aiqbg5yJn6euEjBaBNPJI9S+eGsQLcFRgwdM9vVjf/rgAo+HIKeWgRRuNRlkuYMPpi+HeBZA==
001122334455667, 255, 012345, 3826299600, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ADPeYVRNl/oqZ7fubq0rpQ/9F0A5amZjz7/mfh8fsnvbXvXd/SXiBYgYHKC68u7t9hsNZQ237vKzgDVNrA8crcyt7OzY/wB2Vrom5zrcgh4cl1QR94LU2S8jRLcC5gl9wgp/bkFVMhHGj/HnbuRTuS8kwo5xJAUf0f3FTTh5QUEUq27upYsz32kCqFVnzAKm7wH2rju1VgXxstfozLGy7MeEehz7Hw4VFMCyKAzIBA==
33800130000, 21, 012345, 3826299600, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ADPeYVRNl/oqZ7fubq0rpQ9MwAB/ix5cJZC9et6AOBKhBxe4qBQUD8jYD1N3baMJnJtc8fkfHEuBoKoZNgfnnDU/Oka2EIQiTEfsyTWMHd0d7ZXDWoZMqmYMygZU5TW/XXbgH6JdtMChOfoGHEL5aLCPyz9B0Jwvxxg0/KwTze/V6w6fKLunx0mifl3lPgNAo2qrjXHP3EnlrnFPJ73nZzmnDzMp8Uq5ZrawH976ag==
33800130000, 12, 543210, 3826299600, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ADPeYVRNl/oqZ7fubq0rpQ9BoYGN0nV+w7qkSQLc9+THqUYEii3XruWAuF4b2KYlL2ltYCO3+ZeoKpFPclSAXGKz9zKAIDrQ0lXETSIcXcFUq5MqtKGpTe7d9uR7c6AnFhPZeoRyOWV/9uY6o3nqNzVEq0mUCVK3d6dxPKdcoAYDiUTlL0m39YI205i4zAIVnQZPoSiXoaDgfCkZhhdZpwqqHwOqPbs1pOVv6tvgVQ==
3380013000, 1, 012345, 3826299600, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ADPeYVRNl_oqZ7fubq0rpQ-tpUVK3hjbg0ppQcAlOtIF5q-2VE0xY_tqFpLnsx-0XW4GFIRemr9iM3ePapOznbaauRp74OgR2zttSDHXBbX5tZbJwfMmNGZ4xnps93s6l3480UKjOj5BDilX9mY6-ndzCzYaTbBgK6aiqbg5yJn6euEjBaBNPJI9S-eGsQLcFRgwdM9vVjf_rgAo-HIKeWgRRuNRlkuYMPpi-HeBZA==
001122334455667, 255, 012345, 3826299600, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ADPeYVRNl_oqZ7fubq0rpQ_9F0A5amZjz7_mfh8fsnvbXvXd_SXiBYgYHKC68u7t9hsNZQ237vKzgDVNrA8crcyt7OzY_wB2Vrom5zrcgh4cl1QR94LU2S8jRLcC5gl9wgp_bkFVMhHGj_HnbuRTuS8kwo5xJAUf0f3FTTh5QUEUq27upYsz32kCqFVnzAKm7wH2rju1VgXxstfozLGy7MeEehz7Hw4VFMCyKAzIBA==
33800130000, 21, 012345, 3826299600, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ADPeYVRNl_oqZ7fubq0rpQ9MwAB_ix5cJZC9et6AOBKhBxe4qBQUD8jYD1N3baMJnJtc8fkfHEuBoKoZNgfnnDU_Oka2EIQiTEfsyTWMHd0d7ZXDWoZMqmYMygZU5TW_XXbgH6JdtMChOfoGHEL5aLCPyz9B0Jwvxxg0_KwTze_V6w6fKLunx0mifl3lPgNAo2qrjXHP3EnlrnFPJ73nZzmnDzMp8Uq5ZrawH976ag==
33800130000, 12, 543210, 3826299600, 34af7f978c5a17772867d929e0b800dd2db74608322d73f2f0cfd19cdcaeccc8, 04c14d9db89a3dd8da8a366cf26cd67f1de468fb5dc15f240b0d2b96dbdb5f39af962cb0bdc0bafcc9e523bf5cd4eba420c51758f987457954d32f1003bbaaf1c5, 3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd, 045f802c016b2d14ef4d7ef01617c67c7506c0cd08aed3e4bcaf34ef5ffaddebb70a073d82c37bc874ce6705cec8b1c4a03b2ccd8f28b0c5034fb8774f2e97b1a4, ADPeYVRNl_oqZ7fubq0rpQ9BoYGN0nV-w7qkSQLc9-THqUYEii3XruWAuF4b2KYlL2ltYCO3-ZeoKpFPclSAXGKz9zKAIDrQ0lXETSIcXcFUq5MqtKGpTe7d9uR7c6AnFhPZeoRyOWV_9uY6o3nqNzVEq0mUCVK3d6dxPKdcoAYDiUTlL0m39YI205i4zAIVnQZPoSiXoaDgfCkZhhdZpwqqHwOqPbs1pOVv6tvgVQ==
......@@ -117,7 +117,7 @@ async function cleaRenewLSP(config) {
output = await encrypt(header, msg, config.PK_SA);
// Convert output to Base64
return btoa((Array.from(new Uint8Array(output))).map(ch => String.fromCharCode(ch)).join(''));
return btoa((Array.from(new Uint8Array(output))).map(ch => String.fromCharCode(ch)).join('')).replace(/\+/g, '-').replace(/\//g, '_');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment