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 b10a8735 authored by Merisier Tac's avatar Merisier Tac
Browse files

Fix locationTemporaryPublicId computation

nameUUIDFromBytes is not a straightfoward conversion of an UUID in byte
array representation to the same UUID in the UUID class. Rather, it
generates an UUID from an array of byte by some black magic involving
md5 hashing...
parent b934a599
Pipeline #241604 passed with stages
in 8 minutes and 1 second
......@@ -299,7 +299,10 @@ public class CleaEciesEncoder {
byte[] tlidB = hmacSha256.doFinal(message.getBytes("UTF-8"));
/* Convert in UUID format */
byte[] tlidBTrunc = Arrays.copyOfRange(tlidB, 0, 16);
locationTemporaryPublicID = UUID.nameUUIDFromBytes(tlidBTrunc);
ByteBuffer bb = ByteBuffer.wrap(tlidBTrunc);
long high = bb.getLong();
long low = bb.getLong();
locationTemporaryPublicID = new UUID(high, low);
return locationTemporaryPublicID;
} catch (InvalidKeyException | NoSuchAlgorithmException | IllegalStateException | UnsupportedEncodingException e) {
......
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