The text of a manual · part 13 of 15
Ingenico 6780 User's Guide: 10 Secure Certificate
Pages 102 to 110 of 119, from Ingenico 6780 User's Guide
The original document is the PDF (1.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Ingenico i6780
Page 102
Chapter 10
Secure Certificate Overview
10.1
This chapter is extracted from the NAR Secure Certificate document, part 0190-002520103, revision 1.03. The secure certificate file is a descriptor of all of the software components that are necessary to make up one or more applications that are going to be downloaded to the Secure PIN Entry Device, such as the i6780. Note:
Terms used in this chapter are explained in Terminal Architecture on page 81.
If the secure Code MACing option is enabled, the downloaded application must provide what is called a “secure certificate file” (certific.txt). This file contains security information for every file and application to be downloaded. It can also indicate which application, code file, or data file needs to be deleted. This certificate is mandatory if Code MACing is enabled. During the terminal download process, if the downloaded certificate file is valid and the download is successful, SSA will replace the previous copy, if it exists, with the new copy. The secure certificate file will also be used each time the terminal starts up to authenticate the MAC of the user application’s CFS and DFS if the security option “Terminal Startup Verify MAC Option” is enabled. The following section describes how the securing process uses the secure certificate and gives practical considerations for application developers.
Securing Process
10.2
The securing process can be used during the validation of the application code files and application data files. The secure certificate will be downloaded into the data file system (DFS) first, along with code files and data files. The secure certificate contains all security-related information, and information about all of the code files and data files in the download package. The securing process is composed of the following steps: 1. The secure certificate is used to validate the complete download of all required download files. If Code MACing is enabled, downloading any file that is not listed in the secure certificate file causes the download to fail. 2. The maintenance application sends a request to SSA to validate the secure certificate file.
94
Chapter 10 Secure Certificate Section 10.1 Overview
Page 103
3. The secure certificate file is used to validate the signature of code files and data files as soon as they are installed. The secure certificate can also be accessed as needed throughout the download procedure. 4. If the download is successful, the secure certificate file will be erased from a temporary location and updated into SSA’s memory.
10.3
Secure Certificate Text File The secure certificate is a text file that contains security information for a download package. Once the text file is constructed, it must be passed through a securing utility which generates the MAC of the certificate. The utility will also generate MACs for all of the software components described in the certificate. The secure certificate contains all the security information necessary for SSA to determine if the downloaded application is eligible to upgrade. The secure certificate is also a descriptor of all the software components that are necessary to make up a download session. In effect, the secure certificate represents an application descriptor file that contains secured fingerprints for each of the software components representing the application. The following is an example of a secure certificate text file. MAC=12345678 [VisaPEDMode] 1 [Appl] MAC=12345678 applname dstfilename.ext authmethod encrypt srcfilename.ext [SecFiles] MAC=12345678 applname dstfilename.ext class authmethod encrypt existence srcfilename.ext MAC=12345678 applname dstfilename.ext class authmethod encrypt existence srcfilename.ext [NonSecFiles] applname filename.ext class existence applname filename.ext class existence [DeleteAppl] applname codefilename1 applname codefilename2 [DeleteFiles] applname filename.ext class applname filename.ext class [DeleteWholeApp] applname
Ingenico 6780 User’s Guide
95
Page 104
Note:
All lines within the secure certificate text file are terminated with a character sequence carriage return followed by line feed (e.g., <cr><lf>) except for the last line of the file.
The fields of the file are described more fully in the sections that follow.
Secure Certificate Descriptor Sections
10.4
The following descriptor sections make up a secure certificate:
10.4.1
ƒ
Secure certificate MAC descriptor section
ƒ
Visa PED mode descriptor section
ƒ
Application descriptor section
ƒ
Secure file descriptor section
ƒ
Non-secure file descriptor section
ƒ
Delete application code file descriptor section
ƒ
Delete data file descriptor section
ƒ
Delete the whole application descriptor section
Secure Certificate MAC Descriptor Section This section, which is the MAC of the secure certificate file, must exist on the first line of the file. If it does not, validation fails. If it does, a MAC is calculated on the secure certificate, using SHA1 + MAC, starting from the first character of the second line of the file until the end of the file. If the MAC detected on the first line of the file is not the same as the calculated MAC, validation fails. The first line of the file must be in the following format: MAC=12345678 The first field of the application descriptor is the MAC for the secure certificate file itself. ƒ
MAC= is a text string indicating that the precalculated fingerprint follows
ƒ
12345678 is the Hex ASCII representation of the most significant 4 bytes of the MAC value of the SHA1 result for the whole certificate file, precalculated and applied by the securing utility prior to download.
Note:
96
The first line of the file must end with a carriage return and line feed. The second line is considered to begin at the first character immediately after the first carriage return and line feed characters of the file.
Chapter 10 Secure Certificate Section 10.4 Secure Certificate Descriptor Sections
Page 105
10.4.2
Visa PED Mode Descriptor Section The Visa PED mode descriptor section allows you to set the terminal into a special mode that meets the Visa PIN encryption device (PED) requirements. Visa PED mode should be entered before downloading. The section identifier [VisaPedMode]<cr><lf> marks the beginning of the Visa PED mode section within the file. The Visa PED Mode descriptor section is found after the secure certificate MAC section identifier and before the start of the next section identifier (i.e., encountered by <cr><lf>[). The first line of the file must look like this: mode ƒ mode represents the value of the Visa PED mode before the certificate file is updated and before the download starts.
Possible Values
Description
;
No security mode is set.
1–7
B0 – Visa PED mode
(00000B2B1 B0)
B1 – Code MACing
1
Visa PED mode.
(000000001)
Visa PED mode will not be enabled if the secure text entry key and the clear text entry key are not injected, or if the download key is not injected.
2
Code MACing.
(000000010)
Code MACing will not be enabled if the download key is not injected.
3
Visa PED mode and Code MACing.
(000000011)
Visa PED mode and Code MACing will not be enabled if the secure text entry key and clear text entry key are not injected, or if the download key is not injected.
4
Prompt MACing.
(000000100)
Prompt MACing will not be enabled if the secure text entry key and clear text entry key are not injected.
5
Visa PED Mode and Prompt MACing.
(000000101)
This option will not be enabled if the secure text entry key and clear text entry key are not injected, or if the download key is not injected.
6
Prompt MACing and Code MACing.
(000000110)
This option will not be enabled if the secure text entry key and clear text entry key are not injected, or if the download key is not injected.
7
Visa PED mode and Prompt MACing and Code MACing.
(000000111)
This option will not be enabled if the secure text entry key and clear
B2 – Prompt MACing
Ingenico 6780 User’s Guide
97
Page 106
text entry key are not injected, or if download key is not injected.
The three security options (Visa PED Mode, Prompt MACing, and Code MACing) can only be turned off through the key injection module. If the Visa PED mode section indicates to turn Visa PED mode on, but the platform code files (in the download package or terminal) cannot pass the authentication or cannot find MAC information in the certificate file, then Visa PED mode cannot turn on and the download fails. If the Visa PED Mode section indicates to turn Code MACing on, but the platform and financial application code files (in the download package or terminal) cannot pass the authentication or cannot find MAC information in the certificate file, Code MACing cannot turn on and the download fails. Note:
The first line of the file must end with a carriage return and line feed. The second line is considered to begin at the first character immediately after the first carriage return and line feed characters of the file.
10.4.3
Application Descriptor Section The application descriptor section is an area of the secure certificate file that contains information pertaining to the application code files. The section identifier [Appl]<cr><lf> marks the beginning of the application descriptor section within the file. The section ends before the start of the next section identifier (i.e., encountered by <cr><lf>[), or the end of the file. There must be at least one application descriptor; otherwise, the secure validation process fails. Only the first application descriptor is accepted and parsed within the application section. The application descriptor is in the format: MAC=12345678 applname dstfilename.ext authmethod encrypt srcfilename.ext The first field of the application descriptor is the MAC for the application. ƒ
MAC= is a text string identifying that the pre-calculated fingerprint follows
ƒ
12345678 is the Hex ASCII representation of the most significant 4 bytes of the MAC applied by the securing utility prior to download.
ƒ applname represents the application name of the application binary being loaded. For instance: CA2100_IBMEF
ƒ dstfilename.ext represents the code file name of the application binary file residing in the terminal. For instance: WW002G011010
ƒ authmethod represents the code file authentication method, i.e., the MAC calculation method that the code file used. Possible values:, SHA1+MAC
98
Chapter 10 Secure Certificate Section 10.4 Secure Certificate Descriptor Sections
Page 107
- CBC+MAC. Use Code Download MAC Key: CDMK XOR 0x0000 0000 0000 00FF for each half of the key to do MAC calculation/verification. The MAC is calculated before the code file is encrypted. If the code file is specified to be encrypted, then the calculated data needs to be a multiple of 8 bytes. If it isn’t, the generated encrypted code file will have zeros appended at the end of the file for MAC calculation. ƒ encrypt represents whether the code file is encrypted and needs to be decrypted. Possible values: Y, N. If the code file is encrypted, it should be encrypted under the variant of CDMK. The applied variant method is use CDMK XOR 0x0000 0000 0000 FF00 for each half of the key to do encryption/decryption. If the code file needs to be encrypted, the MAC value will be calculated and it will be added to the certificate file. Next, it will encrypt the code using the variant of CDMK starting from address 0x0200 (the code file header is not encrypted). If the code file is not a multiple of 8 bytes, the last data block will have zeros appended for encryption calculation. The number of zeros that are appended to the code file are also appended to the end of the output encrypt file (e.g., adds “4” to represent four zeros). An encrypted code file will be generated with extension ‘.enc’. The encrypted application code file thus consists of three portions:, The first 0x0200 bytes (i.e. 512 bytes) are the first 512 bytes of the original application code file in clear form., The second portion is variable in length depending on the size of the original application code file. It consists of groups of encrypted data. Each group is of 8 bytes long. The last group is padded with 0’s to make up 8 bytes, if necessary, before encryption., The third portion is one byte long. Its value indicates the number of 0’s padded to the last group of data. It is in clear form., Note: Code file 0 won’t be encrypted even if the encrypt field is specified to be “yes.”
ƒ
10.4.4 srcfilename.ext represents the relative or full path of the code file residing in the computer. For instance: code\ WW002G011010. This field is not used by the secure process, but will be used by the securing utility.
Secure File Descriptor Section The secure file descriptor section is an area of the secure certificate file that contains information pertaining to the files that require secure fingerprint validation. By being able to define the files that require fingerprint validation, the developer can maintain some level of control over what and how much of the application needs to be validated. Note:
If an application has parameter files that could change dynamically from an external source, then these files can be defined in the non-secure section, thus escaping the rigors of fingerprint validation. The securing party has ultimate control
Ingenico 6780 User’s Guide
99
Page 108
over whether to accept or reject such a configuration. This decision is made prior to MACing the secure certificate. The secure file descriptor section is found after the identifier [SecFiles]<cr><lf> and before the next section identifier (i.e., encountered by <cr><lf>[), or end of the file. The secure file descriptor is in the format: MAC=12345678 applname dstfilename.ext class authmethod encrypt existence srcfilename.ext The first field of the secure file descriptor is the MAC for the application data file. ƒ
MAC= is a text string identifying that the pre-calculated fingerprint follows.
ƒ
12345678 is the Hex ASCII representation of the most significant 4 bytes of the MAC applied by the securing utility prior to download.
ƒ applname represents what application this data file belongs to.
ƒ dstfilename.ext represents the relative path and file name where the data file will reside in the UNICAPT 32 file system. For instance: bitmaps/card.bmp
ƒ class represents the particular categorization of the file within the terminal’s file system. Possible values: 0=private, 1=public.
ƒ authmethod represents the data file authentication method, i.e., the MAC calculation method that the data file used. Possible values:, SHA1+MAC, CBC+MAC. Use Code Download MAC Key: CDMK XOR 0x0000 0000 0000 00FF for each half of the key as the variant of CDMK to do MAC calculation/verification. The variant of CDMK that results from the XOR operation is used for both methods. The MAC is calculated before the data file is encrypted. If the data file is specified to be encrypted, then the calculated data needs to be a multiple of 8 bytes. If it isn’t, the generated encrypted code file will have zeros appended at the end of the file for MAC calculation.
ƒ encrypt represents whether the data file is encrypted and needs to be decrypted. Possible values: Y, N. If the data file is encrypted, it should be encrypted under the variant of CDMK. Use Code Download MAC Key: CDMK XOR 0x0000 0000 0000 00FF for each half of the key as the variant of CDMK to do encryption/decryption. If the data file is specified to be encrypted, the MAC value is calculated and then added to the certificate file. Next, it will encrypt the data using the variant of CDMK. If the data file is not a multiple of 8 bytes, the last data block will have zeros appended for encryption calculation. The number of zeros that are appended to the code file are also appended to the end of the output encrypt file (e.g., adds “4” to represent four zeros). An encrypted data file will be generated with extension ‘.enc’. The encrypted secure data file thus consists of two portions:, The first portion is variable in length, depending on the size of the
100
Chapter 10 Secure Certificate Section 10.4 Secure Certificate Descriptor Sections
Page 109
original application code file. It consists of groups of encrypted data. Each group is of 8 bytes long. If necessary, the last group is padded with zeros to make up 8 bytes before encryption., The second portion is one byte long. Its value indicates the number of zeros padded to the last group of data. It is in clear form. ƒ existence is an option to determine whether the file must exist in terminal memory in order for secure validation to succeed., “Y” indicates that the file must exist. If Y is selected and the file exists but does not validate, then the secure process fails., “N” indicates the file need not exist. If N is selected, then the file optionally may or may not exist for validation to succeed.
ƒ srcfilename.ext represents the full or relative DOS path and file name that the data file binary resides in. This field is not used by the secure process, but may be used by the securing utility.
Note: When Visa PED Mode is on, the BIN configuration file has to be included in the Security File Section, and the applname should be SSA.
10.4.5
Non-Secure File Descriptor Section The non-secure file descriptor section is an area of the secure certificate file that contains information pertaining to the files that do not require secure fingerprint validation. All files of an application that have not been defined in the secure file section must be defined in the non-secure file section. The non-secure file descriptor section begins with the descriptor [NonSecFiles]<cr><lf>. This section ends with the start of the next section header (i.e., encountered by <cr><lf>[), or end of the file. The non-secure file descriptor is in the format: applname filename.ext class existence ƒ applname represents what application this data file belongs to.
ƒ filename.ext represents the relative path and file name where the data file will reside in the UNICAPT 32 file system. For instance : bitmaps\card.bmp
ƒ class represents the particular categorization of the file within the terminal’s file system. Possible values: 0=private, 1=public.
ƒ existence is an option to determine whether the file must exist in terminal memory in order for secure validation to succeed., “Y” indicates that the file must exist. If Y is selected and the file exists but does not validate, then the secure process fails., “N” indicates the file need not exist. If N is selected, then the file optionally may or may not exist for validation to succeed.
Ingenico 6780 User’s Guide
101
Page 110
10.4.6
Delete Application Code File Descriptor Section The delete application code file descriptor section is an area of the code to be deleted. The delete application code file descriptor section begins with the descriptor [DeleteAppl]<cr><lf>. The section ends with the start of the next section header (i.e., encountered by “<cr><lf>[“), or end of the file. The delete code file descriptor is in the format: applname codefilename
10.4.7
ƒ applname represents the application that this code file belongs to.
ƒ codefilename represents the code file that belongs to an application. For example, CA0003001000.
Note:
The operating system, maintenance application, and System & Security Application cannot be deleted. Only the financial application can be deleted.
Delete Data File Descriptor Section The delete data file descriptor section is an area of the data file that contains information pertaining to the files to be deleted. The delete data file descriptor section begins with the descriptor [DeleteFiles]<cr><lf>. The section ends with the start of the next section header (i.e., encountered by <cr><lf>[), or end of the file. The delete file descriptor is in the format: applname filename.ext class
10.4.8
ƒ applname represents the application this data file belongs to.
ƒ filename.ext represents the relative path and file name where the data file resides in the UNICAPT 32 file system. For instance: bitmaps\card.bmp
ƒ class represents the particular categorization of the file within the terminal’s file system. Possible values: 0=private, 1=public.
Delete Whole Application Descriptor Section The delete whole application descriptor section is an area of application to be deleted. The delete whole application descriptor section begins with the identifier [DeleteWholeApp]<cr><lf>. This section ends with the start of the next section header (i.e., encountered by <cr><lf>[), or end of the file. The delete whole application descriptor is in the format: applname ƒ Note:
102 applname represents the application name that is going to be deleted. For example: US0901_UPOS. The operating system, maintenance application, and System & Security Application cannot be deleted. Only the financial application can be deleted.
Chapter 10 Secure Certificate Section 10.4 Secure Certificate Descriptor Sections