alts: ensure only the first few bytes of key are used

Fixes grpc/grpc#19271
This commit is contained in:
Carl Mastrangelo 2019-06-06 14:59:22 -07:00 committed by GitHub
parent be819fa3fd
commit f8ba38a0e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -136,7 +136,7 @@ class AltsHandshakerClient {
throw new IllegalStateException("Could not get enough key data from the handshake.");
}
byte[] key = new byte[KEY_LENGTH];
result.getKeyData().copyTo(key, 0);
result.getKeyData().substring(0, KEY_LENGTH).copyTo(key, 0);
return key;
}