Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 02971032 authored by Cypres TAC's avatar Cypres TAC
Browse files

update test for LSP base64 padding

parent 9ac5d99e
Pipeline #240567 passed with stages
in 6 minutes and 51 seconds
......@@ -199,25 +199,18 @@ class LocationSpecificPartTest {
* using several type of padding
*/
@Test
public void testDecodingInBase64withDifferentaPadding() throws Exception {
public void testDecodingInBase64withPadding() throws Exception {
final String serverAuthoritySecretKey = "3108f08b1485adb6f72cfba1b55c7484c906a2a3a0a027c78dcd991ca64c97bd";
/* message encrypted, from C package with different padding */
String lspBase64Pad0 = "AMSXLACY_zHatRP_ikRhFsR2sQW2hIaN7ZfvfHhYL02sYoxXnk4VAi-nqTeA2f312xVRYHCFgQOviOfT1yOlrBh0Wp7xVAEghYzqwhoCm9dWjMl6G4IM4rEHPmiLOkCxYp75_aIWavRSA-1NB6E";
final int nbPad = 5;
final String[] variousPad = {"=", "%3d", "%3D"};
LocationSpecificPart[] lsp = new LocationSpecificPart[variousPad.length];
final String Pad = "=";
LocationSpecificPartDecoder decoder = new LocationSpecificPartDecoder(serverAuthoritySecretKey);
LocationSpecificPart lsp0 = decoder.decrypt(lspBase64Pad0+variousPad[0]);
for (int i = 0; i < variousPad.length; i++) {
lsp[i] = decoder.decrypt(lspBase64Pad0+variousPad[i]);
}
for (int i = 0; i < variousPad.length; i++) {
assertThat(lsp0).isEqualTo(lsp[i]);
}
LocationSpecificPart lsp0 = decoder.decrypt(lspBase64Pad0);
LocationSpecificPart lsp = decoder.decrypt(lspBase64Pad0+Pad);
assertThat(lsp0).isEqualTo(lsp);
}
/**
......
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