@Test @Ignore public void testCreateWorkflowTrace() { RunningModeType mode = RunningModeType.CLIENT; final WorkflowTrace hello0 = workflowConfigurationFactory.createWorkflowTrace(WorkflowTraceType.HELLO, mode); final WorkflowTrace hello1 = workflowConfigurationFactory.createWorkflowTrace(WorkflowTraceType.HELLO, mode); Assert.assertTrue(workflowTracesEqual(hello0, hello1)); final List<WorkflowTrace> list = new ArrayList<>(WorkflowTraceType.values().length); for (WorkflowTraceType workflowTraceType : WorkflowTraceType.values()) { if (workflowTraceType == WorkflowTraceType.SIMPLE_MITM_PROXY) { mode = RunningModeType.MITM; } else { mode = RunningModeType.CLIENT; } if (workflowTraceType == WorkflowTraceType.DYNAMIC_HELLO && mode != RunningModeType.CLIENT) { continue; } WorkflowTrace newTrace = workflowConfigurationFactory.createWorkflowTrace(workflowTraceType, mode); Assert.assertNotNull(newTrace.getMessageActions()); Assert.assertFalse(newTrace.getMessageActions().isEmpty()); for (MessageAction action : newTrace.getMessageActions()) { if (action instanceof ReceiveAction) { Assert.assertNotNull(((ReceiveAction) action).getExpectedMessages()); Assert.assertFalse(((ReceiveAction) action).getExpectedMessages().isEmpty()); } else { Assert.assertNotNull(action.getMessages()); Assert.assertFalse(action.getMessages().isEmpty()); } } for (WorkflowTrace trace : list) { if (workflowTracesEqual(trace, newTrace)) { Assert.fail(MessageFormat.format( "The WorkflowConfigurationFactory is expected to produce different WorkflowTraces " + "for each WorkflowTraceType but there is a duplicate pair: {0} {1}", trace, newTrace)); } } list.add(newTrace); } }
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);  }