Level 3 test platform
Testing a terminal needs cards and hosts that behave exactly as a test asks:
- a card that answers with a given cryptogram, refuses a command or is taken away mid-way;
- a host that declines, doesn’t answer, or sends a script.
a7pay simulates both, and records and checks what happened, on the public formats of EMVCo’s Level 3 Testing Framework. Test material written in those formats can run here, and test material written here follows an industry format. Terms in bold are in the glossary.
The EMVCo Level 3 Testing Framework
Section titled “The EMVCo Level 3 Testing Framework”Level 3 testing checks a whole terminal integrated with an acquirer, beyond the kernels. EMVCo’s framework standardises the files a test tool exchanges, so that tests, cards and results move between tools and labs:
| File | What it is | In a7pay |
|---|---|---|
| Card image (XML) | A test card: its applications, and for each command the terminal may send, the card’s answer. Answers can compute dynamic values (a cryptogram, a counter, a signature) through pseudo-functions | emvco::l3::card_image, played by card_sim |
| Card/Terminal log (XML) | Every command the terminal sent the card, and the card’s answer | emvco::l3::ct_log |
| Response profiles (XML) | How the simulated host answers: match requests on their fields, then approve, decline, delay, stay silent, change fields | emvco::l3::response_profiles |
| Online Message log (XML) | Every message exchanged with the host, field by field, with whether the host found the MAC, cryptogram and PIN valid | emvco::l3::oml |
| Pass criteria (CSV) | The checks deciding a test: a data item of a log compared with a value, in steps chained into a verdict | emvco::l3::criteria |
Versions: Implementation Guidelines v1.3, Pseudo-function Definitions v1.6, Common Syntax for Online Message Responses v1.0.
The pieces
Section titled “The pieces”The card simulator (emvco::l3::card_sim::CardSimulator) plays one interface of a card
image as a card reader. To the terminal, it is a Reader like any other (see
Platform).
- It answers each command with the most specific matching entry of the image, or the framework’s defaults.
- It remembers the data the terminal sent, so it can compute the pseudo-functions:
- cryptograms, and checking the issuer’s ARPC on the second GENERATE AC;
- DDA, fDDA and CDA signatures, signed live with the image’s own RSA keys;
- the CVM-related card data, from what the terminal supports;
- country and currency as the terminal sends them;
- card challenges and the card’s transaction counter;
- Kernel 8’s key agreement, encrypted records and MACs.
- It writes the Card/Terminal log.
The kernel signal log (emvco::l3::signal_log) is a7pay’s own addition. It records every
message and Outcome the kernels and Entry Point signal, in order, so that pass criteria can
check them (SIG. data items): “the Outcome was Online Request with a CVM of online PIN”,
“the reader displayed Present card”.
The pass criteria evaluator (emvco::l3::criteria) runs a test’s checks over the three
logs:
- APDU data items over the Card/Terminal log;
- NET data items over the Online Message log;
- SIG data items over the signal log.
It also handles:
- the framework’s known checks (
TT_ARQC_VALIDATE,SIM_ARQC_VALIDATE,SIM_PIN_VALIDATION,LOG_RESET); - the masks deciding which checks apply to which terminal;
- the CSV character substitution.
The network simulator (nexo::l3::netsim, feature l3 of nexo) is a nexo acquirer
host answering from response profiles. It:
- checks the terminal’s MACs, cryptograms and PINs;
- adds the issuer’s ARPC and scripts;
- writes the Online Message log.
nexo messages map onto the framework’s NET data items through nexo::l3::oml: ISO 8583 data
element numbers where the framework uses them, and an XML. branch for every field.
The runners put it together:
| Runner | Runs | Used by |
|---|---|---|
a7pay::emvco::l3::runner::run (feature l3) |
A test case through the reader’s transaction (Entry Point and the kernels): card image, transaction data, pass criteria | The Level 2 test suites |
vpoi suite |
A test case through the whole terminal (nexo FAST) against the network simulator | The test environment’s test cases |
A test case can run several transactions on the same card, e.g. a tap, then a second tap after the online answer.
Time. The card simulator and the cryptography provider share a virtual clock:
- nothing sleeps;
- a card’s processing time is exactly what the test declares;
- relay resistance timing is measured exactly.
a7pay’s additions to the formats
Section titled “a7pay’s additions to the formats”Where the framework’s formats couldn’t express what a test needs, a7pay adds to them, each addition named so that it can’t be confused with the standard:
- Card images:
presentment="n": answers for a second tap;time="n": the card’s processing time, in hundreds of microseconds;mute="TRUE": the card doesn’t answer, as if taken away;<RSAKeys>: the card’s RSA keys, to sign live.
- Pseudo-functions:
a7.cda(content, fields)re-signs a recorded CDA signature live. - Cryptography where only scheme specifications would do:
emvcard.AC()for every cryptogram, and a keyless ARPC (card_sim::arpc) computed by the network simulator and checked by the card. Scheme cryptograms need the schemes’ specifications. - Pass criteria:
SIG.data items, withSIG.T<k>.for the k-th transaction of a test, andA./C.for before or after the host’s answer;- the
MASK(mask, expected)value; - the
find nextoperator.
Not done yet
Section titled “Not done yet”- ISO 8583. The network simulator speaks nexo only. ISO 8583 isn’t planned: there is no single standard to follow (every acquirer and scheme has its own variant), and a7pay favours the newer ISO 20022 standards.
- Test sessions: the framework’s test session files and its test selection tool (questions, applicability). The terminal’s context for the masks is given by the caller.
- Pseudo-functions:
- the magnetic stripe ones (
emvcard.msd, CVC3); - XDA signatures;
- scheme cryptograms by version (the
cvnattribute); - offline PIN;
- the card checking issuer script MACs.
- the magnetic stripe ones (