Skip to content

Commit be45c12

Browse files
committed
added first message action functions
1 parent ec258c5 commit be45c12

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

TLS-Core/src/main/java/de/rub/nds/tlsattacker/core/workflow/WorkflowTrace.java

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,51 @@ public ReceivingAction getLastReceivingAction() {
331331
return null;
332332
}
333333

334+
/**
335+
* Get the first MessageAction of the workflow trace.
336+
*
337+
* @return the first MessageAction of the workflow trace. Null if no message
338+
* actions are defined
339+
*/
340+
public MessageAction getFirstMessageAction() {
341+
for (int i = 0; i < tlsActions.size(); i++) {
342+
if (tlsActions.get(i) instanceof MessageAction) {
343+
return (MessageAction) (tlsActions.get(i));
344+
}
345+
}
346+
return null;
347+
}
348+
349+
/**
350+
* Get the first SendingAction of the workflow trace.
351+
*
352+
* @return the first SendingAction of the workflow trace. Null if no sending
353+
* actions are defined
354+
*/
355+
public SendingAction getFirstSendingAction() {
356+
for (int i = 0; i < tlsActions.size(); i++) {
357+
if (tlsActions.get(i) instanceof SendingAction) {
358+
return (SendingAction) (tlsActions.get(i));
359+
}
360+
}
361+
return null;
362+
}
363+
364+
/**
365+
* Get the first ReceivingActionAction of the workflow trace.
366+
*
367+
* @return the first ReceivingActionAction of the workflow trace. Null if no
368+
* receiving actions are defined
369+
*/
370+
public ReceivingAction getFirstReceivingAction() {
371+
for (int i = 0; i < tlsActions.size(); i++) {
372+
if (tlsActions.get(i) instanceof ReceivingAction) {
373+
return (ReceivingAction) (tlsActions.get(i));
374+
}
375+
}
376+
return null;
377+
}
378+
334379
public String getName() {
335380
return name;
336381
}

0 commit comments

Comments
 (0)