Skip to content

Commit

Permalink
Fix #786: Key converter initialization should not be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
romanstrobl committed Mar 26, 2020
1 parent 952df75 commit 738419d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
package io.getlime.security.powerauth.lib.webflow.authentication.method.form.encryption;

import com.google.common.io.BaseEncoding;
import io.getlime.security.powerauth.crypto.lib.config.PowerAuthConfiguration;
import io.getlime.security.powerauth.lib.webflow.authentication.encryption.AesEncryptionPasswordProtection;
import io.getlime.security.powerauth.provider.CryptoProviderUtilBouncyCastle;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -38,6 +40,7 @@ class AesEncryptionPasswordProtectionTest {
@BeforeAll
static void setUp() {
Security.addProvider(new BouncyCastleProvider());
PowerAuthConfiguration.INSTANCE.setKeyConvertor(new CryptoProviderUtilBouncyCastle());
}

@org.junit.jupiter.api.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package io.getlime.security.powerauth.app.webflow;

import io.getlime.security.powerauth.crypto.lib.config.PowerAuthConfiguration;
import io.getlime.security.powerauth.provider.CryptoProviderUtilFactory;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
Expand All @@ -38,6 +40,9 @@ protected SpringApplicationBuilder configure(SpringApplicationBuilder applicatio
// Register BC provider
Security.addProvider(new BouncyCastleProvider());

// Tell PowerAuth components to use BC provider
PowerAuthConfiguration.INSTANCE.setKeyConvertor(CryptoProviderUtilFactory.getCryptoProviderUtils());

return application.sources(PowerAuthWebFlowApplication.class);
}

Expand Down

0 comments on commit 738419d

Please sign in to comment.