1. Field of the Invention
This invention relates generally to the field of communications occurring on an I2C bus.
2. Background of the Related Art
An inter-IC bus, commonly called an IIC or I2C bus, is a control bus that provides a communication link between integrated circuits in a system. Currently there is no standard way to secure an I2C communications channel and thus, like all unsecured systems, systems employing I2C communications are vulnerable to attack and tampering. As an example, a somewhat sophisticated attacker could surreptitiously open up a machine employing an I2C bus, such as a server, and install a commonly-available I2C writer tool on the I2C bus. The I2C writer tool allows the traffic on the bus to be monitored, or “snooped” as such monitoring is often called in the computer security field. This would allow the attacker to determine how the resources on the bus are being enabled or disabled. Armed with this information, legitimate transactions occurring on the I2C bus could be replicated (and thus appear as legitimate transactions themselves) by the attacker.
One reason that an I2C bus can be attacked so easily is that it is a well-defined open bus and multiple masters can legitimately reside on the bus and co-exist peacefully. In a multiple-master environment of the prior art, each master will be aware that transactions initiated by others are taking place on the bus, but they are unable to determine if these other transactions are legitimate transactions or “rogue” transactions initiated by an intruder. In a single-master environment, the master could be programmed to detect any other transactions occurring (i.e., transactions not initiated by the single master) and operate on the assumption that such transactions are rogue, however, a sophisticated attacker could modify a transaction initiated by the master and such modifications could go undetected. Thus, an attacker can essentially communicate on the I2C bus transparently. This allows rogue masters to enter the bus, communicate with devices on the bus, and change and/or read data that are on those devices without the overall system knowing that those events have happened.
Accordingly, it would be desirable to have the capability to authenticate communications occurring on an I2C bus to assure that the communications are legitimate.
The present invention enables authenticated communications (transactions) to take place on a standard I2C bus without requiring modification of existing I2C devices. Read and write transactions occurring on the bus are authenticated using an Authentication Agent and a shared secret key. In addition to allowing verification of the legitimacy of the transactions, the authentication of the I2C transactions enhances the reliability and serviceability of the bus and devices on the bus by allowing the Baseboard Management Controller (BMC) to quickly determine and pinpoint errors.
In a preferred embodiment, a secret key is shared between the BMC and the Authentication Agent. The BMC and Authentication Agent separately perform a cryptographic hash on the data that is transmitted on the bus, and the hash value created by the BMC is compared with the hash value created for the same transaction data by the Authentication Agent. A match indicates an authentic, error-free transaction; a mis-match indicates an illegitimate or error in the transaction. The use of the secret key prevents an attacker from falsely authenticating a transaction on the bus.
In accordance with the present invention, an Authentication Agent 110 is coupled to the I2C bus 106 so that it is in communication with all of the devices communicating over the I2C bus 106. In its most basic form, Authentication Agent 110 comprises a key register 112, a decryption engine 113, a hash register 114, and a hash engine 116. Authentication agent 110 can communicate with all devices on the I2C bus and is addressable itself so that other devices on the I2C bus can communicate with it.
In the embodiment illustrated in
The Authentication Agent 110 resides on the I2C bus 106 and detects and monitors all I2C transactions that occur on the bus. A feature of the I2C protocol, referred to as a “repeated start condition,” is utilized in connection with the present invention. The repeated start condition allows a bus master, e.g., BMC 102 to continually initiate new transactions without re-arbitrating for control of the bus. Thus, the bus master can issue new transactions with the same data as many times as desired while maintaining bus control.
Using a standard start condition, the I2C Master initiates the transaction with the I2C device over the I2C bus, and at the end of the transaction to this particular I2C device, instead of generating a stop condition, which terminates the transaction, it issues a repeated start condition, and instead of addressing the target device with the repeated transmission it initiates a write transaction to the Authentication Agent residing on the I2C bus over which the transaction is taking place. By using the repeated start condition, instead of having two separate bus transactions, a single continuous repeated transaction occurs. Repeated start transactions are used to ensure the proper grouping of data and hash values in a multi-master environment. If repeated start transactions are not used, it may be possible for a competing master to win I2C arbitration during the hash write stage, thus corrupting the verification process.
The use of repeated start transactions does not preclude the use of a repeated start transaction to access I2C devices (such as I2C NVRAMs). If the Authentication Agent is not the target of the transaction following a repeated start transaction, the Authentication Agent will continue to snoop the bus and use the additional address and data to continue calculating the hash. The Authentication Agent should treat repeated start transactions that mix reads and writes the same as transactions that simply do reads or writes. The BMC of the present invention is configured to correctly hash these repeated start read/write transactions.
Since the Authentication Agent snoops the entire transaction occurring on the bus (e.g., it receives the identical data transmitted to the I2C device from the master), it can create a hash value based on the same information, using hash engine 116. Since the BMC is the device that, assuming the transmission was legitimate, created all of that information, it too can create a hash based on that information. The BMC then encrypts the hash using its secret key and transmits the encrypted hash to the Authentication Agent. The Authentication Agent then decrypts the hash using decryption engine 113 and the hash register is configured to compare the two hash values (i.e., the hash value created by the Authentication Agent is compared with the hash value received from the BMC) using known comparison methods, e.g., two-input logic gates that issue a first digital value if the two inputs are the same and a second digital value if the two inputs are not the same. If the hash value calculated by the Authentication Agent differs from the hash value calculated by the BMC, it is known that either a rogue device initiated the transmission or there was an error in the transmission. In either case, this is valuable information to know. The Authentication Agent then signals the error via the error channel 118. The BMC can then take appropriate action, that is, to resend the transmission or determine where the security breach occurred. If a read or write transaction occurs on a bus (and is thus snooped by the Authentication Agent monitoring the bus) and the Authentication Agent does not receive the hash value that is calculated by the BMC for the transaction, the Authentication Agent signals to the BMC, via error channel 118, that an error has occurred.
The Authentication Agent and BMC should use only the information contained in each byte transfer to calculate the hash. START, STOP, and ACK/NACK bits should not be used in calculation of the hash. Additionally, the Authentication Agent should not include the hash transmission transaction in its hash calculation.
The same hash algorithm is used by both the BMC and the Authentication Agent. The BMC and Authentication Agent may alternatively employ public key cryptography to encrypt and decrypt the hashes, or any other known cryptographic technique. To use a public key method, the BMC may create the public-private key pair. The public key can be transmitted to the key register in the Authentication Agent and the BMC retains the private key. After the BMC computes the hash for a transaction, it uses its private key to encrypt the hash. The Authentication Agent then uses the BMC's public key to decrypt the hash.
The above-described embodiment provides a system for allowing transactions occurring on an I2C bus to be authenticated, a significant improvement over systems of the prior art. However, a sophisticated attacker could disconnect Authentication Agent 110 from the I2C bus 106 in an attempt to bypass the tampering detection it provides. In accordance with a preferred embodiment of the present invention, the system of
A sophisticated attacker could also disconnect or spoof the error channel 118 between the BMC 102 and the Authentication Agent 110. To combat this type of attack, in a preferred embodiment, the BMC 102 is configured to periodically address and transmit random data to the Authentication Agent 110. The Authentication Agent 110 is configured to accept this random data and perform no action on it. The BMC 102 will then calculate and encrypt the hash and transmit it to the Authentication Agent in the normal fashion, but periodically the BMC 102 will deliberately corrupt the hash value before transmission. The Authentication Agent 110 will decrypt the potentially corrupted hash and compare it as it normally would, and signal an error on the error channel 118 as appropriate. Since the BMC 102 “knows” that hash it created is correct or incorrect, it will expect an appropriate error response on the error channel 118. Since, in this attack scenario, the error channel 118 between the Authentication Agent 110 and BMC 102 has been disconnected or spoofed, no such error signal, or an incorrect error signal, will be received by the BMC, and the BMC will assume the occurrence of a problem and take corrective action.
At step 306, the Authentication Agent snoops the transaction and calculates a hash value using its secret key and the transaction information (address plus data). At step 308, I2C Master issues a repeated start transaction on the I2C bus, addressed to the Authentication Agent, and writes the I2C′s master's calculated hash created in step 302. If the I2C master receives a negative acknowledgment code (NAK) when addressing and communicating with the Authentication Agent (step 309), it should proceed to step 314 for error determination. If no NAK is received, at step 310 the Authentication Agent decrypts the I2C Master's hash value with its key and compares it with the hash value it created.
At step 312, if it is determined that the hash values do not match or if no hash was received by the Authentication Agent before the transaction was terminated with a STOP command, the process proceeds to step 314, where the transaction is deemed to be problematic, and an investigation is initiated. If the investigation indicates the existence of a simple error, the transaction may be resent. If the investigation indicates a possible security breach, measures can be taken to remedy the breach. A simple error may be indicated by the BMC completing the full transaction and receiving an error via the error channel. A security breach may be indicated by the BMC receiving an error via the error channel without it having issued an associated transaction. The process then proceeds directly to step 318, described below.
If at step 312 it is determined that the hash values do match, the transaction is authenticated at step 316 and no remedial action is required. The process then proceeds to step 318, where a determination is made as to whether or not there are additional transactions being issued on the bus. If there are, the process proceeds back to step 302; if there are not, the process ends.
If no NAK is received by the I2C master at step 409, at step 410, the Authentication Agent decrypts the I2C master's hash and compares the result with its calculated hash value. If, at step 412, it is determined that no match exists or if no hash was received by the Authentication Agent before the transaction was terminated with a STOP command, it is concluded that there is a problem with the transaction and an investigation of the problem is initiated (step 414). If, at step 412, it is determined that there is a match, the transaction is authenticated (step 416).
At step 418, it is determined if there are any additional transactions to be transmitted. If there are additional transactions, the process proceeds back to step 402. If there are no additional transactions, the process ends.
In a preferred embodiment, the Authentication Agent of the present invention can comprise a micro-controller containing a shared key decryption engine, a cryptographic hash engine, a hash register, and a write-once non-volatile key register. A CPLD, ASIC, or FPGA could be used instead of a micro-controller if desired. The write-once register is used as the key for the decryption engine, and is not readable. Optionally the device could implement a clear pin or register bit that would clear the contents of the key register. The hash engine uses the shared key (for HMAC authentication) and data from the I2C bus to generate a hash value. The hash value is stored in the hash register. If an I2C mux sits between the BMC and the I2C slave as shown in
Preferably, the cryptographic hash algorithm should use a secret key to ensure that the hash output cannot be easily recreated by inspection of the I2C data alone, i.e., HMAC authentication.
Prior to operation, an initialization process should be performed to set the system up for operation. The system should be initialized in a physically secure environment since the BMC will be transmitting keys in plain text over the I2C bus. In an exemplary initialization process, the BMC first receives a command to initialize the Authentication Agents. Included in this command is the shared secret key to be used for all communications. The BMC stores this key in its non-volatile storage. The BMC then proceeds to write this key to the write-once registers of all the attached Authentication Agents. The BMC then validates that all the Authentication Agents keys have been written properly by performing at least one authenticated transaction to an I2C device on each bus (as described above with respect to
As an alternative, the BMC code and Authentication Agents could have the secret key embedded in their designs. This would eliminate the Initialization procedure. However, care would have to be taken to make sure that the key is not recoverable from code updates, using any known manner.
The above-described steps can be implemented in hardware and/or using standard well-known programming techniques. The novelty of the above-described embodiment lies not in the specific programming techniques but in the use of the steps described to achieve the described results. Software programming code which embodies the present invention is typically stored in permanent storage of some type, such as permanent storage of the BMC. In a client/server environment, such software programming code may be stored with storage associated with a server. The software programming code may be embodied on any of a variety of known media for use with a data processing system, such as a diskette, or hard drive, or CD-ROM. The code may be distributed on such media, or may be distributed to users from the memory or storage of one computer system over a network of some type to other computer systems for use by users of such other systems. The techniques and methods for embodying software program code on physical media and/or distributing software code via networks are well known and will not be further discussed herein.
It will be understood that each element of the illustrations, and combinations of elements in the illustrations, can be implemented by general and/or special purpose hardware-based systems that perform the specified functions or steps, or by combinations of general and/or special-purpose hardware and computer instructions.
These program instructions may be provided to a processor to produce a machine, such that the instructions that execute on the processor create means for implementing the functions specified in the illustrations. The computer program instructions may be executed by a processor to cause a series of operational steps to be performed by the processor to produce a computer-implemented process such that the instructions that execute on the processor provide steps for implementing the functions specified in the illustrations. Accordingly, the figures support combinations of means for performing the specified functions, combinations of steps for performing the specified functions, and program instruction means for performing the specified functions.
Although the present invention has been described with respect to a specific preferred embodiment thereof, various changes and modifications may be suggested to one skilled in the art and it is intended that the present invention encompass such changes and modifications as fall within the scope of the appended claims.
Number | Name | Date | Kind |
---|---|---|---|
4085448 | Kogge | Apr 1978 | A |
4991085 | Pleva et al. | Feb 1991 | A |
5206948 | De Angelis et al. | Apr 1993 | A |
5210862 | DeAngelis et al. | May 1993 | A |
5644636 | Fernandez | Jul 1997 | A |
5815647 | Buckland et al. | Sep 1998 | A |
5996034 | Carter | Nov 1999 | A |
6055660 | Meaney | Apr 2000 | A |
6233635 | Son | May 2001 | B1 |
6237112 | Yoo et al. | May 2001 | B1 |
6397315 | Rahman et al. | May 2002 | B1 |
6574758 | Eccles | Jun 2003 | B1 |
6684266 | Faber et al. | Jan 2004 | B2 |
6957312 | Chou et al. | Oct 2005 | B1 |
7107464 | Shapira et al. | Sep 2006 | B2 |
20020147920 | Mauro | Oct 2002 | A1 |
20050111420 | Fujii | May 2005 | A1 |
20050204155 | Ravi et al. | Sep 2005 | A1 |
20050273592 | Pryor et al. | Dec 2005 | A1 |
20060063594 | Benbrahim | Mar 2006 | A1 |
20060107054 | Young | May 2006 | A1 |
Number | Date | Country |
---|---|---|
1474273 | Feb 2004 | CN |
1700634 | Nov 2005 | CN |
WO 03060841 | Jul 2003 | WO |
Number | Date | Country | |
---|---|---|---|
20070143606 A1 | Jun 2007 | US |