Embedded devices such as integrated circuit processing devices provide multiple interfaces to outside entities. These interfaces make a variety of features available, such as testing, code and data transfer and access to memory. However, these interfaces can also be exploited for gaining unauthorized access to information stored contained within the device. By altering information used by the device, a user can obtain access to services which have not been paid for or which are confidential as well as the keys used to cryptographically protect information.
As the number of wireless and internet-connected devices increases, built-in protection becomes an important feature of the devices. Industry-wide, there is a continuing effort to define trusted computing platforms. One of the characteristics of trusted platform is a tamper-resistant interaction with the outside environment.
One of the interaction points between an integrated circuit and the external world is the JTAG port, which system designers typically provide for debugging purposes. A JTAG port is a port that conforms to a standard developed by the Joint Test Action Group and provides external test access to integrated circuits. The port uses a four- or five-pin external interface. The JTAG standard has been adopted as the standard IEEE 1149.
A JTAG port can be used to alter a device's memory, or retrieve sensitive information from the device. To prevent this, the port is often disabled in production devices. However, disabling the port prevents authorized users from making use of the port for future testing, modification or field evaluation of products.
The IEEE-1149 standard defines a mandatory set of public instructions that must be present in a JTAG-compliant implementation. This mandatory set includes the instructions IDCODE, BYPASS, EXTEST and INTEST. From this set only the INTEST instruction reveals or allows manipulation of the internal core-logic signals of the integrated circuit. For example, it is possible to re-program flash memory or alter unguarded secured information when the suitable data is supplied along with this instruction. The IDCODE instruction is used to retrieve the hard-wired identification number of the device. The BYPASS and EXTEST instructions are used for the boundary scan. In addition to the mandatory set, an optional or private set of instructions can be defined for a device.
Since the JTAG port gives access to the internal system components of the processor, there are a number of situations where protection of the JTAG port would be beneficial.
Other gateway interfaces to an embedded device would benefit from hardware protection, in similar manner as the JTAG port.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as the preferred mode of use, and further objects and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawing(s), wherein:
While this invention is susceptible of embodiment in many different forms, there is shown in the drawings and will herein be described in detail one or more specific embodiments, with the understanding that the present disclosure is to be considered as exemplary of the principles of the invention and not intended to limit the invention to the specific embodiments shown and described. In the description below, like reference numerals are used to describe the same, similar or corresponding parts in the several views of the drawings.
The protected JTAG block 110 includes a level controller 112 and an access manager 114. The access manager 114 includes a random number generator 116 and a verifier module 118. The operation of these elements is discussed below.
The required supporting infrastructure and tools include a Secure Server 120 and a protected JTAG Manager, which works with the debugging tools on the host JTAG equipment 108. The protected JTAG block 110 (also referred hereafter simply as a protected JTAG) provides authentication functions and access mode control for each supported level of access defined for the processor 100. In addition, the processor is configured to accept enhanced JTAG signaling. The access restrictions are handled by additional hardware blocks within the protected JTAG 110: Level Controller 112 and Access Manager 114. These combine to set the access mode for the protected JTAG.
JTAG Access Modes.
In one embodiment, the Protected JTAG 110 is configurable to allow a number of different access modes, corresponding to different levels of protection. Embedded devices provide various types of service. Some products do not need security measures, and it is appropriate to grant non-restricted JTAG access to these devices by all users. An example could be a complex electronic toy, or home equipment controller. The demand for a protected JTAG materializes in products that have trusted computing requirements. Examples include cellular telephones, PDAs, media devices and automotive controllers.
In addition to a variety of products imposing different protection requirements, different points in the product life cycle require different access levels. Any new device goes through different phases during its lifetime. After the device is designed, it has to be developed, tested, assembled, and built into a product. A product's required protection varies during these phases.
A Protected JTAG 110 provides different levels of protection. The fully protected level limits user access through the JTAG port to external functions such as test of chip circuitry and board level interconnections. Optionally, non-intrusive internal component testing can be allowed. This optional component testing feature should not reveal any private information and not allow write to the memory or processor's registers. Implementation of this feature may be architecture specific. The middle protection level allows programming flash memory and reading and writing to registers and memory, except from within the secure area. The lowest protection level does not offer any protection and allows full access including unlimited access to the secure area.
A Protected JTAG 110 provides the means for granting appropriate access by providing a tamper-resistant state selection capability. The states determined by hardware configuration correspond to access modes. Once the mode is set, it is possible to change it to a new mode of greater protection, but not to a mode that provides lower protection. In one embodiment, the access modes are derived from a set of fuses. The fuse technology must be such that the fuses are set irreversibly. Burning a set of fuses determines a security level. Burning more fuses increases the level. Thus the security level can be only increased.
Each of the access modes has a default protection level. Once the access mode is established, the level of protection can be temporarily lowered by authorized users only. The diagram in
The table below summarizes the protected JTAG applicability and access levels to all and authorized users, in each access mode, for one embodiment. The access modes are described in more detail below.
Lowering Protection Level in Low and Non Protected Access Mode. The JTAG port 104 (
Furthermore, products without built-in security (i.e., without protected data) do not need any protection. It is appropriate to grant full access to such products through the JTAG port.
Low Protection Access Mode. In the Low Protection Access mode, the user is still able to view protected data through JTAG port, as well as write to the flash memory. However in this mode the secure information such as private keys or secret data are tamper resistant but not necessarily hidden. The restrictions would be imposed by architecture dependent security mechanism. For the reason that the user is capable of assembling confidential or private data, this access is given only to trusted users. This mode can be used during the development phase, when the secure area has been successfully verified. Additionally this mode can be sufficient to restore field returns, for example to re-flash memory.
In some cases it may be necessary to open the security mechanism. It is possible to reduce the protection level temporarily to the unprotected level. This capability can be used by a restricted group of trusted users, who have the strongest credentials.
High Protection Access Mode. To prevent the user from accessing secured memory (protected data), the product delivered to the customer should not provide any access to secure data through the JTAG port 104 (
In some applications the boundary test or component test can be more complex and require more intrusive methods. The INTEST or SAMPLE standard instructions or other private instructions can be used for this purpose. However, these instructions should not reveal the contents of the secure memory and should not allow write access to the processor memory.
A product configured with the low or high protection access mode can have the protection level reduced temporarily, if requested by a trusted user. From low protection mode the level can go down to Non Protected, where from high protection mode the protection level can go down to Low Protection or Non Protected levels, depending on the user's credentials. This feature of protected JTAG is intended for debugging functions on field returns.
High Gated Protection Access Mode. This access mode provides all the features of high access mode. The difference is an additional exit event that is accepted to terminate the lowered protection JTAG session. In this mode, the protection is restored back to the default by the device after each JTAG instruction. This feature could be added to ensure the device will not be left compromised in case of the human error after successful certification and testing session. However this mode would be implemented selectively. The implementation of this feature is rather complex and devices that would not use it may not implement it at all. The complexity results from the requirement of detecting the end of each JTAG instruction. This implies additional logic within JTAG. The condition would be then passed to the Level Controller block.
Maximum Protection Access Mode. JTAG access in maximum protection mode is the same as in the high protection access mode. The difference between the two is the option of temporarily downgrading the protection level in the high protection access mode. This capability is not supported in the maximum protection access mode.
This mode is intended for the products delivered to the customer that contain very sensitive information. In this case, the protected data is not meant to be accessed via JTAG under any conditions by anyone.
Other products that could adopt this type of protection could be inexpensive devices, where it is more economical to replace the device than it is to repair it.
Protected JTAG Authorization.
In one embodiment, the protected JTAG authorization process is based on challenge-response identification algorithm. A designated secure server (120 in
Referring to
The random number is generated by the random number generator part of the Access Manager (116 in
Referring again to
At (206) the JTAG Manager opens a connection, such as a secure socket layer connection, with the secure server. At (208) the JTAG Manager passes the challenge phrase, device's ID along with the host's and user's computer credentials to the secure server (120 in
The response phrase is then verified by the Verifier block within the Access Manager module, by comparing the response with the original random information that was generated as part of the challenge. If successful, the response phase is acknowledged at (214) and the requested level of access is enabled until the device next power down or detection of CLOSE bit sequence. A device configured to the High Gated protection mode would additionally return to the default protection level at the end of each JTAG instruction. Once access is enabled, the user tools may connect to the protected JTAG at (216). This connection is acknowledged at (218) and test commands can be issued at (220) to interface with the device via the protected JTAG until device power down or a CLOSE bit sequence is issued by the JTAG Manager at (222).
The state transition diagram in
The authorization scheme presented here relies on generation of the challenge and response pair for each access. This “per access” authorization scheme rules out the possibility of an unauthorized user using old bit sequences in the future in a replay attack.
The Access Manager module of the protected JTAG is implemented in hardware in such a way as to allow the authorization process to run independently from the processor. The hardware solution guarantees a reliable authorization even if the processor's software has been tampered with or the processor hardware is the cause of the problem that is being evaluated. Several advantages of hardware JTAG implementation in the trusted platform environment can be listed. For one, the JTAG port can be used by an authorized user to debug the main processor's boot sequence when the trusted boot failed and debugging is required on field returns. It can also be used to debug the running system when the tamper attempt or other failure was detected. In order to enable the JTAG port to debug the boot sequence, the JTAG public key has to be part of the JTAG hardware, separated from the main processor, in tamper-resistant memory.
Hardware Implications.
Protected JTAG. As shown in
The Level Controller 112 is configured to provide the tamper resistant, irreversible state selection solution corresponding to access modes. In the example shown in
The signals exchanged between the protected JTAG blocks themselves and between the processor 102 should also be tamper proof and hidden in the internal silicon layer. The signals indicating protection level will be applied in the internal JTAG and/or processor logic. The logic applying the signals inside the processor has to be architecture specific.
Secure Server. As mentioned before, a secure server 120 is provided to facilitate the authorization process (described above with reference to
In one embodiment, the user 108 and secure server 120 use a secure interface which allows communication of information, such as the challenge 122, credentials 124 and response 126, as a serial string.
Cryptographic Considerations
The secure server 120 (
Verification of user credentials by the secure server is an important part of the whole scheme. A variety of verification methods are known to those of ordinary skill in the art.
Development and Test Tools.
The protected JTAG functions need development tools support. The tools should be capable of communicating with the Protected JTAG Access Manager module to pass the authorization related data to the secure server. The authorization process depicted in
The basic architecture and functionality of protected JTAG are disclosed above. Protected JTAG complements a trusted platform, offering important debugging features and yet protecting secure information. The core attributes of the solution presented here are the hardware implementation, diverse levels of access, and a highly secure mechanism based on the generation of challenge/response pair for each access. These attributes make the tool attractive for a wide variety of users and safe from a security perspective. The developers are able debug and test during the implementation phase. After the device is delivered to the customer, any repair shop can verify the circuit correctness but only users with credentials can debug the device deeper when this type of intervention is required.
The main objective of the Protected JTAG is to prohibit the JTAG access by all individuals that possibly could misuse the device. Yet, based on previous experience, JTAG can be a crucial point of access to the device. The flexibility of attaining protection and access through the JTAG port is achieved by the lowering protection access through authorization. The advantages are mostly noticeable when the device is in high protection access mode.
Examples of Use.
A couple of use cases are included below to illustrate the benefits of Protected JTAG.
Lower Access (low protection)—Loading Flash Memory. The owner of cell phone, Bob say, found an interesting game on web and downloaded it to his cellular telephone. After the download, his phone stopped working properly. First Bob tried to fix the problem himself. He found the “good” code on the internet and wanted to load the code to his phone device using the JTAG port. Note that several vendors provide hardware and software tools that can be used to re-flash the memory of a device. Bob connected the device through the JTAG port to the host PC using the hardware JTAG tool and ran the software tools on his host PC to download the code. Since the device was in high protection mode, it did not allow flash memory to be altered. The tools returned a general error message. In this instance the device was protected from loading unsecured code.
In order to recover the device, Bob had to bring the device to the provider shop. A trusted technician, Maverick say, is authorized to make the modifications in Bob's device. He had to lower the protection of the device to the low protection access through authorization process. He connected the device through the JTAG port to his host PC through the JTAG hardware tool. The software tools on the host PC contain the JTAG manager module. Maverick initiated the authorization procedure by invoking the OPEN command from the JTAG manager. At the time he also specified the type of OPEN as low protection access. JTAG manager sent the request to the Protected JTAG on the device. The protected JTAG answered with the challenge phrase. Upon receiving the challenge phase, the JTAG manager tool on host requested authorizing entry from Maverick. Maverick entered his credentials. The JTAG manager passed the challenge phrase and Maverick's credentials to the designated secure server. The secure server verified the credentials. After successful verification, the secure server generated response to the given challenge and sent it back to the JTAG manager. The JTAG manager passed the response to the Protected JTAG on the device and disconnected from the secure server. The protected JTAG verified the response. Upon successful verification the Protected JTAG granted the requested access to the device through the JTAG port. Maverick used the hardware JTAG connector and software tools on the host to initiate the re-flashing. The command completed successfully. After completion of the request, Maverick had to power down the device to restore the default access level.
Acquire Lowest Protection. Hackers extracted secure keys from the type of the phone that Bob has. The service provider offered Bob a key replacement. Bob brought his phone to the provider's shop. Maverick, the technician from the shop, runs the authorization procedure requesting non protected access. After successful authorization Maverick could access secure memory on the device. Maverick used the hardware JTAG connector and software tools on the host to initiate writing to secure memory. The command completed successfully. Upon finishing the activities, Maverick had to restore the default JTAG access by powering down the device.
Those of ordinary skill in the art will recognize that the present invention has been described in terms of exemplary embodiments based upon use of a JTAG port. However, the invention should not be so limited, since the present invention could be implemented using other access ports. For example, both standards-based ports and custom ports may be integrated with an access manager and a level controller to form a protected access port.
Certain elements of the present invention, as described in embodiments herein, are implemented using a programmed processor executing programming instructions that are broadly described above in sequential diagram and state diagram form that can be stored on any suitable electronic storage medium. However, those skilled in the art will appreciate that the processes described above can be implemented in any number of variations and in many suitable programming languages without departing from the present invention. For example, the order of certain operations carried out can often be varied, additional operations can be added or operations can be deleted without departing from the spirit and scope of the invention. Error trapping can be added and/or enhanced and variations can be made in user interface and information presentation without departing from the present invention. Such variations are contemplated and considered equivalent.
While the invention has been described in conjunction with specific embodiments, it is evident that many alternatives, modifications, permutations and variations will become apparent to those of ordinary skill in the art in light of the foregoing description. Accordingly, it is intended that the present invention embrace all such alternatives, modifications and variations as fall within the scope of the appended claims.