Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ELY-1471] Rework the WildFlyElytronProvider to be a static definition instead of a dynamically generated definition. #1061

Merged
merged 1 commit into from Feb 8, 2018

Conversation

darranl
Copy link
Contributor

@darranl darranl commented Jan 3, 2018

This drastically reduces the class loading overhead just to initialise the Provider.

@wildfly-ci
Copy link

Linux - JDK9 Build 133 outcome was FAILURE using a merge of 6a2c594
Summary: Tests failed: 113 (113 new), passed: 826, ignored: 9 Build time: 00:03:00

Failed tests

org.wildfly.security.sasl.otp.OTPTest.testAuthenticationWithMultiWordOTPWithAlternateDictionary: java.lang.AssertionError
	at org.wildfly.security.sasl.otp.OTPTest.testAuthenticationWithMultiWordOTPWithAlternateDictionary(OTPTest.java:473)


org.wildfly.security.sasl.otp.OTPTest.testSimpleMD5AuthenticationWithMultiWordOTP: java.lang.AssertionError
	at org.wildfly.security.sasl.otp.OTPTest.testSimpleMD5AuthenticationWithMultiWordOTP(OTPTest.java:222)


org.wildfly.security.sasl.otp.OTPTest.testAuthenticationWithLongSeed: java.lang.AssertionError
	at org.wildfly.security.sasl.otp.OTPTest.testAuthenticationWithLongSeed(OTPTest.java:806)


org.wildfly.security.sasl.otp.OTPTest.testAuthenticationWithNonAlphanumericSeed: java.lang.AssertionError
	at org.wildfly.security.sasl.otp.OTPTest.testAuthenticationWithNonAlphanumericSeed(OTPTest.java:841)


org.wildfly.security.sasl.otp.OTPTest.testUnauthorizedAuthorizationId: java.lang.AssertionError
	at org.wildfly.security.sasl.otp.OTPTest.testUnauthorizedAuthorizationId(OTPTest.java:925)


org.wildfly.security.sasl.otp.OTPTest.testSimpleSHA1AuthenticationWithPassPhrase: java.lang.AssertionError
	at org.wildfly.security.sasl.otp.OTPTest.testSimpleSHA1AuthenticationWithPassPhrase(OTPTest.java:171)


org.wildfly.security.sasl.otp.OTPTest.testAuthenticationWithWrongPasswordInInitResponse: java.lang.AssertionError
	at org.wildfly.security.sasl.otp.OTPTest.testAuthenticationWithWrongPasswordInInitResponse(OTPTest.java:693)


org.wildfly.security.sasl.otp.OTPTest.testAuthenticationWithWrongPassword: java.lang.AssertionError
	at org.wildfly.security.sasl.otp.OTPTest.testAuthenticationWithWrongPassword(OTPTest.java:647)


org.wildfly.security.sasl.otp.OTPTest.testAuthenticationWithInvalidPassPhrase: java.lang.AssertionError
	at org.wildfly.security.sasl.otp.OTPTest.testAuthenticationWithInvalidPassPhrase(OTPTest.java:771)


org.wildfly.security.sasl.otp.OTPTest.testSimpleSHA1AuthenticationWithMultiWordOTP: java.lang.AssertionError
	at org.wildfly.security.sasl.otp.OTPTest.testSimpleSHA1AuthenticationWithMultiWordOTP(OTPTest.java:272)


org.wildfly.security.sasl.otp.OTPTest.testMultipleSimultaneousAuthenticationSessions: java.lang.AssertionError
	at org.wildfly.security.sasl.otp.OTPTest.testMultipleSimultaneousAuthenticationSessions(OTPTest.java:570)



##### there are 103 more failed tests, see build details

putService(new Service(this, SASL_SERVER_FACTORY_TYPE, SaslMechanismInformation.Names.IEC_ISO_9798_U_ECDSA_SHA1, "org.wildfly.security.sasl.entity.EntitySaslServerFactory", emptyList, emptyMap));
putService(new Service(this, SASL_SERVER_FACTORY_TYPE, SaslMechanismInformation.Names.IEC_ISO_9798_M_ECDSA_SHA1, "org.wildfly.security.sasl.entity.EntitySaslServerFactory", emptyList, emptyMap));
putService(new Service(this, SASL_SERVER_FACTORY_TYPE, SaslMechanismInformation.Names.EXTERNAL, "org.wildfly.security.sasl.external.ExternalSaslServerFactory", emptyList, emptyMap));
putService(new Service(this, SASL_SERVER_FACTORY_TYPE, "GS2-KRB5-PLUS", "org.wildfly.security.sasl.gs2.Gs2SaslServerFactory", emptyList, emptyMap));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be constant Gs2.GS2_KRB5_PLUS used?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would cause the initialization of the Gs2 class, which may reintroduce the original problem.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -27,7 +27,7 @@
/**
* SHA-512/256 hashing implementation as defined in FIPS PUB 180-4 Secure Hash Standard
*/
public class Sha512_256MessageDigest extends MessageDigestSpi {
public class SHA512_256MessageDigest extends MessageDigestSpi {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why rename this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably should have put that in it's own commit but it popped up in the middle of this clean up - a while ago we agreed to upper case 3 letter acronyms and camel case 4 or more - this is a new class added in Elytron 1.2 so we can get away with a quick rename before it leaks into any API.

@hkalina hkalina added the +1 HK label Jan 3, 2018
putService(new Service(this, ALG_PARAMS_TYPE, ALGORITHM_MASKED_PBKDF_HMAC_SHA512, MaskedPasswordAlgorithmParametersSpiImpl.class.getName(), emptyList, emptyMap));
putService(new Service(this, ALG_PARAMS_TYPE, "RSA", "org.wildfly.security.key.RSAParameterSpiImpl", emptyList, emptyMap));

putService(new Service(this, ALG_PARAMS_TYPE, ALGORITHM_CRYPT_MD5, "org.wildfly.security.password.impl.SaltedPasswordAlgorithmParametersSpiImpl", emptyList, emptyMap));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more efficient approach might be to read all this info from a text file to avoid all these strings sticking around in metaspace forever.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which Strings are you worried about @dmlloyd - The referenced constants or the hard coded ones?

At this stage it felt as though any over optimisation here will be undone as soon as Elytron is actually used one way or another, also although we can use files it seems we would be likely to undo any savings with the classes we load to read the files.

…n instead of a dynamically generated definition.

This drastically reduces the class loading overhead just to initialise the Provider.
@dmlloyd dmlloyd added the +1 DML label Feb 8, 2018
@dmlloyd dmlloyd merged commit c9b4439 into wildfly-security:master Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants