Search code examples
smartcardapdusmartcard-readeremv

Parse CV Rule from CVM List for EMV


I have succesfully retrieved the CVM List from EMV card.

0000 0000 0000 0000 4103 4203 1E03 1F02

From the EMV specification book 3, the first 4 bytes and second 4 bytes are amount and rest is CV rules. Making these the CV Rule 4103 4203 1E03 1F02

The book also shows how to parse the CV rules, as shown below: enter image description here

I am assuming that I need to convert the first two bytes in a CV rule to binary and match with the table above? But why does the table above have empty cells? Also can someone explain in a simple pseudo code algorithm to parse this?


Solution

  • Have you referred section 10.5.5 CVM Processing Logic in the same book ? It has it detailed and even as a flow cart.

    As to the empty bits read as RFU.

    This is how your sample is parsed.

    41 03
    
    41 => 0100 0001
    Apply succeeding CV Rule if this CVM is unsuccessful
    Plaintext PIN verification performed by ICC
    
    03
    If terminal supports the CVM
    ---------------------------------------------------
    
    Similarly, 
    42 03
    
    42
    Apply succeeding CV Rule if thisCVM is unsuccessful
    Enciphered PIN verified online
    
    03
    If terminal supports the CVM
    ----------------------------------------------------
    
    1E03
    
    1E
    Signature (paper)
    
    03
    If terminal supports the CVM
    
    ----------------------------------------------------
    
    1F 02
    
    1F
    No CVM required
    
    02
    If not unattended cash and not manual cash and not purchase
    with cashback