Skip to content

Commit

Permalink
Merge remote-tracking branch 'jmkao/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmkao committed Aug 12, 2016
2 parents b0be978 + 4e491ef commit c5e1908
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,16 +332,16 @@ public Message buildKeyExchange() throws InvalidNameException, CertificateExpire
}

public Message buildEncryptedMessage(ByteBuffer buffer) throws InvalidNameException, InvalidKeyException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException, NoSuchPaddingException, NoSuchAlgorithmException {
if (keyCreatorIV == null || keyReceiverIV == null) {
throw new InvalidKeyException("You need to perform a key exchange with this crypto before you use it");
}

Message keyMessage = new Message();
String[] userIdAndName = LdapUtils.getUserIdAndName(remoteCrypto.verifier.getSubjectDN().getName());
keyMessage.setTo(UUID.fromString(userIdAndName[0]));
userIdAndName = LdapUtils.getUserIdAndName(((X509Certificate)signer.getCertificate()).getSubjectDN().getName());
keyMessage.setFrom(UUID.fromString(userIdAndName[0]));

if (keyCreatorIV == null || keyReceiverIV == null) {
throw new InvalidKeyException("You need to perform a key exchange with this crypto before you use it");
}

byte[] ivBytes = new byte[IV_LENGTH];
synchronized (lockSync) {
InitializationVectorControl properControl = isKeyCreator?keyCreatorIV:keyReceiverIV;
Expand Down

0 comments on commit c5e1908

Please sign in to comment.