phax / as2-lib

A generic Java AS2 library, servlet and server
107 stars 43 forks source link

BCCryptoHelper - Using explicit in BouncyCastleProvider.PROVIDER_NAME instead of m_sSecurityProviderName #55

Closed ihudedi closed 6 years ago

ihudedi commented 6 years ago

Hi Philip, You made a change to support BCFIPS provider in BCCryptoHelper class however there 2 places you left with calling to BC Provider explicit and not via the new parameter m_sSecurityProviderName. In decrypt method you are using BouncyCastleProvider.PROVIDER_NAME instead of m_sSecurityProviderName

if (bLargeFileOn) { aDecryptedDataBodyPart = SMIMEUtil.toMimeBodyPart (aRecipient.getContentStream (new JceKeyTransEnvelopedRecipient (aPrivateKey).setProvider (BouncyCastleProvider.PROVIDER_NAME))); } else { final byte [] aDecryptedData = aRecipient.getContent (new JceKeyTransEnvelopedRecipient (aPrivateKey).setProvider (BouncyCastleProvider.PROVIDER_NAME));

  if (s_aDumpDecryptedDirectory != null)
  {
    _dumpDecrypted (aDecryptedData);
  }

  aDecryptedDataBodyPart = SMIMEUtil.toMimeBodyPart (aDecryptedData);
}
return aDecryptedDataBodyPart;

}

Could you please modify those changes and push them to 4.2.0 Another question is when 4.2.0 should be released?

Thanks a lot, Itay

phax commented 6 years ago

Thanks for pointing that out - fixed. Concerning the 4.2.0 release, I'm struggeling a bit with the finalize method in the class TempSharedFileInputStream. I really don't like having this in, but didn't find the time to really get rid of it. Would it help, if I build a 4.2.0-RC1 version, so that you have something officially released and I find a way to resolve this issue?

ihudedi commented 6 years ago

Hi philip, Thank a lot for the quick response. I will be glad if you will release 4.2.0-RC1