@Test public void testAddStartTlsAction() { config.setStarttlsType(StarttlsType.FTP); workflowConfigurationFactory = new WorkflowConfigurationFactory(config); WorkflowTrace workflowTrace = workflowConfigurationFactory.createWorkflowTrace(WorkflowTraceType.HELLO, RunningModeType.CLIENT); Assert.assertEquals(GenericReceiveAsciiAction.class, workflowTrace.getTlsActions().get(0).getClass()); Assert.assertEquals(SendAsciiAction.class, workflowTrace.getTlsActions().get(1).getClass()); Assert.assertEquals(GenericReceiveAsciiAction.class, workflowTrace.getTlsActions().get(2).getClass()); config.setStarttlsType(StarttlsType.IMAP); workflowConfigurationFactory = new WorkflowConfigurationFactory(config); workflowTrace = workflowConfigurationFactory.createWorkflowTrace(WorkflowTraceType.HELLO, RunningModeType.CLIENT); Assert.assertEquals(GenericReceiveAsciiAction.class, workflowTrace.getTlsActions().get(0).getClass()); Assert.assertEquals(SendAsciiAction.class, workflowTrace.getTlsActions().get(1).getClass()); Assert.assertEquals(GenericReceiveAsciiAction.class, workflowTrace.getTlsActions().get(2).getClass()); config.setStarttlsType(StarttlsType.POP3); workflowConfigurationFactory = new WorkflowConfigurationFactory(config); workflowTrace = workflowConfigurationFactory.createWorkflowTrace(WorkflowTraceType.HELLO, RunningModeType.CLIENT); Assert.assertEquals(GenericReceiveAsciiAction.class, workflowTrace.getTlsActions().get(0).getClass()); Assert.assertEquals(SendAsciiAction.class, workflowTrace.getTlsActions().get(1).getClass()); Assert.assertEquals(GenericReceiveAsciiAction.class, workflowTrace.getTlsActions().get(2).getClass()); config.setStarttlsType(StarttlsType.SMTP); workflowConfigurationFactory = new WorkflowConfigurationFactory(config); workflowTrace = workflowConfigurationFactory.createWorkflowTrace(WorkflowTraceType.HELLO, RunningModeType.CLIENT); Assert.assertEquals(GenericReceiveAsciiAction.class, workflowTrace.getTlsActions().get(0).getClass()); Assert.assertEquals(SendAsciiAction.class, workflowTrace.getTlsActions().get(1).getClass()); Assert.assertEquals(GenericReceiveAsciiAction.class, workflowTrace.getTlsActions().get(2).getClass()); Assert.assertEquals(SendAsciiAction.class, workflowTrace.getTlsActions().get(3).getClass()); Assert.assertEquals(GenericReceiveAsciiAction.class, workflowTrace.getTlsActions().get(4).getClass()); }
public WorkflowTrace createWorkflowTrace(WorkflowTraceType type, RunningModeType mode) { this.mode = mode; switch (type) { case HELLO: return createHelloWorkflow(); case FULL: return createFullWorkflow(); case HANDSHAKE: return createHandshakeWorkflow(); case SHORT_HELLO: return createShortHelloWorkflow(); case SSL2_HELLO: return createSsl2HelloWorkflow(); case CLIENT_RENEGOTIATION_WITHOUT_RESUMPTION: return createClientRenegotiationWorkflow(); case CLIENT_RENEGOTIATION: return createClientRenegotiationWithResumptionWorkflow(); case SERVER_RENEGOTIATION: return createServerRenegotiationWorkflow(); case HTTPS: return createHttpsWorkflow(); case RESUMPTION: return createResumptionWorkflow(); case FULL_RESUMPTION: return createFullResumptionWorkflow(); case SIMPLE_MITM_PROXY: return createSimpleMitmProxyWorkflow(); case ZERO_RTT: return createZeroRttWorkflow(); case FULL_ZERO_RTT: return createFullZeroRttWorkflow(); case FALSE_START: return createFalseStartWorkflow(); case RSA_SYNC_PROXY: return createSyncProxyWorkflow(); case DYNAMIC_HANDSHAKE: return createDynamicHandshakeWorkflow(); case DYNAMIC_HELLO: return createDynamicHelloWorkflow(); } throw new ConfigurationException("Unknown WorkflowTraceType " + type.name()); }
WorkflowConfigurationFactory { public WorkflowTrace createWorkflowTrace(WorkflowTraceType type, RunningModeType mode) { this.mode = mode; switch (type) { case HELLO: return createHelloWorkflow(); case FULL: return createFullWorkflow(); case HANDSHAKE: return createHandshakeWorkflow(); case SHORT_HELLO: return createShortHelloWorkflow(); case SSL2_HELLO: return createSsl2HelloWorkflow(); case CLIENT_RENEGOTIATION_WITHOUT_RESUMPTION: return createClientRenegotiationWorkflow(); case CLIENT_RENEGOTIATION: return createClientRenegotiationWithResumptionWorkflow(); case SERVER_RENEGOTIATION: return createServerRenegotiationWorkflow(); case HTTPS: return createHttpsWorkflow(); case RESUMPTION: return createResumptionWorkflow(); case FULL_RESUMPTION: return createFullResumptionWorkflow(); case SIMPLE_MITM_PROXY: return createSimpleMitmProxyWorkflow(); case ZERO_RTT: return createZeroRttWorkflow(); case FULL_ZERO_RTT: return createFullZeroRttWorkflow(); case FALSE_START: return createFalseStartWorkflow(); case RSA_SYNC_PROXY: return createSyncProxyWorkflow(); case DYNAMIC_HANDSHAKE: return createDynamicHandshakeWorkflow(); case DYNAMIC_HELLO: return createDynamicHelloWorkflow(); } throw new ConfigurationException("Unknown WorkflowTraceType " + type.name()); } }
WorkflowConfigurationFactory { public WorkflowTrace createWorkflowTrace(WorkflowTraceType type, RunningModeType mode) { this.mode = mode; switch (type) { case HELLO: return createHelloWorkflow(); case FULL: return createFullWorkflow(); case HANDSHAKE: return createHandshakeWorkflow(); case SHORT_HELLO: return createShortHelloWorkflow(); case SSL2_HELLO: return createSsl2HelloWorkflow(); case CLIENT_RENEGOTIATION_WITHOUT_RESUMPTION: return createClientRenegotiationWorkflow(); case CLIENT_RENEGOTIATION: return createClientRenegotiationWithResumptionWorkflow(); case SERVER_RENEGOTIATION: return createServerRenegotiationWorkflow(); case HTTPS: return createHttpsWorkflow(); case RESUMPTION: return createResumptionWorkflow(); case FULL_RESUMPTION: return createFullResumptionWorkflow(); case SIMPLE_MITM_PROXY: return createSimpleMitmProxyWorkflow(); case ZERO_RTT: return createZeroRttWorkflow(); case FULL_ZERO_RTT: return createFullZeroRttWorkflow(); case FALSE_START: return createFalseStartWorkflow(); case RSA_SYNC_PROXY: return createSyncProxyWorkflow(); case DYNAMIC_HANDSHAKE: return createDynamicHandshakeWorkflow(); case DYNAMIC_HELLO: return createDynamicHelloWorkflow(); } throw new ConfigurationException("Unknown WorkflowTraceType " + type.name()); } WorkflowConfigurationFactory(Config config); }
WorkflowConfigurationFactory { public WorkflowTrace createWorkflowTrace(WorkflowTraceType type, RunningModeType mode) { this.mode = mode; switch (type) { case HELLO: return createHelloWorkflow(); case FULL: return createFullWorkflow(); case HANDSHAKE: return createHandshakeWorkflow(); case SHORT_HELLO: return createShortHelloWorkflow(); case SSL2_HELLO: return createSsl2HelloWorkflow(); case CLIENT_RENEGOTIATION_WITHOUT_RESUMPTION: return createClientRenegotiationWorkflow(); case CLIENT_RENEGOTIATION: return createClientRenegotiationWithResumptionWorkflow(); case SERVER_RENEGOTIATION: return createServerRenegotiationWorkflow(); case HTTPS: return createHttpsWorkflow(); case RESUMPTION: return createResumptionWorkflow(); case FULL_RESUMPTION: return createFullResumptionWorkflow(); case SIMPLE_MITM_PROXY: return createSimpleMitmProxyWorkflow(); case ZERO_RTT: return createZeroRttWorkflow(); case FULL_ZERO_RTT: return createFullZeroRttWorkflow(); case FALSE_START: return createFalseStartWorkflow(); case RSA_SYNC_PROXY: return createSyncProxyWorkflow(); case DYNAMIC_HANDSHAKE: return createDynamicHandshakeWorkflow(); case DYNAMIC_HELLO: return createDynamicHelloWorkflow(); } throw new ConfigurationException("Unknown WorkflowTraceType " + type.name()); } WorkflowConfigurationFactory(Config config); WorkflowTrace createWorkflowTrace(WorkflowTraceType type, RunningModeType mode); WorkflowTrace createTlsEntryWorkflowtrace(AliasedConnection connection); WorkflowTrace createHelloWorkflow(AliasedConnection connection); boolean shouldServerSendACertificate(CipherSuite suite); ClientKeyExchangeMessage createClientKeyExchangeMessage(KeyExchangeAlgorithm algorithm); ServerKeyExchangeMessage createServerKeyExchangeMessage(KeyExchangeAlgorithm algorithm); void addClientKeyExchangeMessage(List<ProtocolMessage> messages); void addServerKeyExchangeMessage(List<ProtocolMessage> messages); WorkflowTrace addStartTlsActions(AliasedConnection connection, StarttlsType type, WorkflowTrace workflowTrace); }
WorkflowConfigurationFactory { public WorkflowTrace createWorkflowTrace(WorkflowTraceType type, RunningModeType mode) { this.mode = mode; switch (type) { case HELLO: return createHelloWorkflow(); case FULL: return createFullWorkflow(); case HANDSHAKE: return createHandshakeWorkflow(); case SHORT_HELLO: return createShortHelloWorkflow(); case SSL2_HELLO: return createSsl2HelloWorkflow(); case CLIENT_RENEGOTIATION_WITHOUT_RESUMPTION: return createClientRenegotiationWorkflow(); case CLIENT_RENEGOTIATION: return createClientRenegotiationWithResumptionWorkflow(); case SERVER_RENEGOTIATION: return createServerRenegotiationWorkflow(); case HTTPS: return createHttpsWorkflow(); case RESUMPTION: return createResumptionWorkflow(); case FULL_RESUMPTION: return createFullResumptionWorkflow(); case SIMPLE_MITM_PROXY: return createSimpleMitmProxyWorkflow(); case ZERO_RTT: return createZeroRttWorkflow(); case FULL_ZERO_RTT: return createFullZeroRttWorkflow(); case FALSE_START: return createFalseStartWorkflow(); case RSA_SYNC_PROXY: return createSyncProxyWorkflow(); case DYNAMIC_HANDSHAKE: return createDynamicHandshakeWorkflow(); case DYNAMIC_HELLO: return createDynamicHelloWorkflow(); } throw new ConfigurationException("Unknown WorkflowTraceType " + type.name()); } WorkflowConfigurationFactory(Config config); WorkflowTrace createWorkflowTrace(WorkflowTraceType type, RunningModeType mode); WorkflowTrace createTlsEntryWorkflowtrace(AliasedConnection connection); WorkflowTrace createHelloWorkflow(AliasedConnection connection); boolean shouldServerSendACertificate(CipherSuite suite); ClientKeyExchangeMessage createClientKeyExchangeMessage(KeyExchangeAlgorithm algorithm); ServerKeyExchangeMessage createServerKeyExchangeMessage(KeyExchangeAlgorithm algorithm); void addClientKeyExchangeMessage(List<ProtocolMessage> messages); void addServerKeyExchangeMessage(List<ProtocolMessage> messages); WorkflowTrace addStartTlsActions(AliasedConnection connection, StarttlsType type, WorkflowTrace workflowTrace);  }