mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 06:56:53 +00:00
Separate username and signature truncation fields
This commit is contained in:
1 parent
e4da59c236
commit
7b331edcde
3 files changed
+15
-12
No files matched your search
+2
-1
@@ -170,10 +170,11 @@ class ExternalServiceCredentialsGeneratorTest {
|
||||
public void testTruncateLength() throws Exception {
|
||||
final ExternalServiceCredentialsGenerator generator = ExternalServiceCredentialsGenerator.builder(new byte[32])
|
||||
.withUserDerivationKey(new byte[32])
|
||||
.withTruncateLength(14)
|
||||
.withDerivedUsernameTruncateLength(14)
|
||||
.build();
|
||||
final ExternalServiceCredentials creds = generator.generateFor(E164);
|
||||
assertEquals(14*2 /* 2 chars per byte, because hex */, creds.username().length());
|
||||
assertEquals("805b84df7eff1e8fe1baf0c6e838", creds.username());
|
||||
generator.validateAndGetTimestamp(creds);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user