Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-2658

Elytron, mechanism-names and mechanism-oids allows duplicate values

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 3.0.0.Beta16
    • None
    • Security
    • None

      Trying to create kerberos-security-factory specifying KRB5 (1.2.840.113554.1.2.2) mechanism in both mechanism-names and mechanism-oids is succesfull

      [standalone@localhost:9990 /] /subsystem=elytron/kerberos-security-factory=c:add(principal="HTTP/localhost@JBOSS.ORG", path="/path/to/keytab", mechanism-names=[KRB5,SPNEGO], mechanism-oids=["1.2.840.113554.1.2.2"])
      {"outcome" => "success"}
      

      However, later that leads to error GSSException: Duplicate element found: 1.2.840.113554.1.2.2 usage: Accept

      server.log
      07:32:19,873 TRACE [org.wildfly.security] (default task-1) SPNEGO: org.wildfly.security.http.HttpAuthenticationException: ELY05053: [SPNEGO] Callback handler failed for unknown reason
      	at org.wildfly.security.http.impl.SpnegoAuthenticationMechanism.evaluateRequest(SpnegoAuthenticationMechanism.java:118)
      	at org.wildfly.security.http.util.SetMechanismInformationMechanismFactory$1.evaluateRequest(SetMechanismInformationMechanismFactory.java:115)
      	at org.wildfly.security.http.util.SecurityIdentityServerMechanismFactory$1.evaluateRequest(SecurityIdentityServerMechanismFactory.java:77)
      	at org.wildfly.security.http.HttpAuthenticator$AuthenticationExchange.authenticate(HttpAuthenticator.java:115)
      	at org.wildfly.security.http.HttpAuthenticator$AuthenticationExchange.access$100(HttpAuthenticator.java:94)
      	at org.wildfly.security.http.HttpAuthenticator.authenticate(HttpAuthenticator.java:78)
      	at org.wildfly.elytron.web.undertow.server.SecurityContextImpl.authenticate(SecurityContextImpl.java:97)
      	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:55)
      	at io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:53)
      	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
      	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
      	at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:59)
      	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
      	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
      	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1704)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1704)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1704)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1704)
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
      	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:211)
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:809)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.io.IOException: ELY01156: Cannot obtain a credential from a security factory
      	at org.wildfly.security.credential.source.CredentialSource$4.getCredential(CredentialSource.java:327)
      	at org.wildfly.security.auth.server.ServerAuthenticationContext$1.handleOne(ServerAuthenticationContext.java:858)
      	at org.wildfly.security.auth.server.ServerAuthenticationContext$1.handle(ServerAuthenticationContext.java:730)
      	at org.wildfly.security.http.util.SecurityIdentityServerMechanismFactory$SecurityIdentityCallbackHandler.handle(SecurityIdentityServerMechanismFactory.java:113)
      	at org.wildfly.security.http.impl.SpnegoAuthenticationMechanism.evaluateRequest(SpnegoAuthenticationMechanism.java:114)
      	... 37 more
      Caused by: java.security.GeneralSecurityException: GSSException: Duplicate element found: 1.2.840.113554.1.2.2 usage: Accept
      	at org.wildfly.security.auth.util.GSSCredentialSecurityFactory$Builder.createGSSCredential(GSSCredentialSecurityFactory.java:302)
      	at org.wildfly.security.auth.util.GSSCredentialSecurityFactory$Builder.lambda$build$0(GSSCredentialSecurityFactory.java:251)
      	at org.wildfly.security.auth.util.GSSCredentialSecurityFactory.create(GSSCredentialSecurityFactory.java:98)
      	at org.wildfly.security.auth.util.GSSCredentialSecurityFactory.create(GSSCredentialSecurityFactory.java:60)
      	at org.wildfly.security.credential.source.CredentialSource$4.getCredential(CredentialSource.java:325)
      	... 41 more
      Caused by: GSSException: Duplicate element found: 1.2.840.113554.1.2.2 usage: Accept
      	at sun.security.jgss.GSSCredentialImpl.add(GSSCredentialImpl.java:419)
      	at sun.security.jgss.GSSCredentialImpl.<init>(GSSCredentialImpl.java:77)
      	at sun.security.jgss.GSSManagerImpl.createCredential(GSSManagerImpl.java:160)
      	at org.wildfly.security.auth.util.GSSCredentialSecurityFactory$Builder$1.run(GSSCredentialSecurityFactory.java:291)
      	at org.wildfly.security.auth.util.GSSCredentialSecurityFactory$Builder$1.run(GSSCredentialSecurityFactory.java:277)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:422)
      	at org.wildfly.security.auth.util.GSSCredentialSecurityFactory$Builder.createGSSCredential(GSSCredentialSecurityFactory.java:277)
      	... 45 more
      

      mechanism-names and mechanism-oids attributes should be

      • either "deduplicated" - that in result each OID mechanism occures at most once
      • or validated - that duplicate values are not configured

              jkalina@redhat.com Jan Kalina (Inactive)
              mchoma@redhat.com Martin Choma
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: