Abstract:
A smart card including a processor unit associated with a ROM and with a programmable ROM. The ROM contains an operating program that can be executed by the processor unit and that includes functional portions, each defining a function of the processor unit. The program includes an entry/exit point for each functional portion and an identifier is associated with each functional portion. The programmable ROM contains at least one substitutable functional portion suitable for substituting one of the functional portions of the ROM and associated with an identifier corresponding to the identifier of the corresponding functional portion of the ROM, and the processor unit is arranged to execute the substitutable functional portion instead of the corresponding substitutable functional portion of the ROM.

Description:
[0001]    The present invention relates to a smart card suitable for use in particular as a data medium, e.g. for constituting means for identifying a carrier of the card, means for accessing premises or equipment, means for payment such as a bank card or a telephone card, . . . . 
       BACKGROUND OF THE INVENTION 
       [0002]    A smart card generally comprises a body having fastened thereto an integrated circuit that includes a processor that forms a processor unit, a read-only memory (ROM), and a programmable ROM, e.g. of the electrically-erasable programmable read-only memory (EEPROM) type. The processor unit is arranged to execute an operating program that is in contained in the ROM and that comprises functional portions, each defining a function of the processor unit. The data used by the processor unit is generally contained in the programmable ROM. ROMs are less expensive than programmable ROMs, so using a ROM for storing the operating program serves to limit the cost of the smart card. However, the operating program needs to be stored in the ROM at the time the integrated circuit is fabricated and it is no longer modifiable thereafter. Improving the operating program, and more generally, making any modification thereto, therefore requires new integrated circuits to be fabricated. 
       OBJECT OF THE INVENTION 
       [0003]    An object of the invention is to provide means enabling the operating program to be modified in simple and rapid manner, and in a manner that is optionally applicable to existing cards. 
       BRIEF DESCRIPTION OF THE INVENTION 
       [0004]    To this end, the invention provides a smart card including a processor unit associated with a ROM and with a programmable ROM, the ROM containing an operating program that can be executed by the processor unit and that includes functional portions, each defining a function of the processor unit. The program includes an entry/exit point for each functional portion, and an identifier is associated with each functional portion. The programmable ROM contains at least one substitutable functional portion suitable for substituting one of the functional portions of the ROM and associated with an identifier corresponding to the identifier of the corresponding functional portion of the ROM. The processor unit is arranged to execute the substitutable functional portion instead of the corresponding functional portion of the ROM. 
         [0005]    The entry/exit points of the operating program are thus arranged between each of the functional portions so that the processor unit can short-circuit an original functional portion of the operating program and instead execute a substitutable functional portion stored in the programmable ROM. In addition, the multiplicity of entry/exit points in the operating program makes it possible to limit the sizes of the program pieces that make up the substitutable functional portions stored in the programmable ROM to the sizes of the functional portions that are to be replaced. The amount of programmable ROM that is occupied by the substitutable functional portions is thus relatively small. The substitutable functional portions may be stored in the programmable ROM not only by the manufacturer of the integrated circuit, but also by the issuer of the cards, thereby simplifying management thereof. 
         [0006]    Advantageously, the substitutable functional portion is loaded into a start zone of the programmable ROM. 
         [0007]    This makes it possible to accelerate searching for substitutable functional portions such that execution of the operating program is not slowed down in harmful manner. 
         [0008]    Preferably, the programmable ROM includes an indicator for indicating the presence of a substitutable functional portion. 
         [0009]    Thus, the processor unit can quickly detect whether it is necessary to read the programmable read-only memory in order to search for a substitutable functional portion. 
         [0010]    Also preferably, the processor unit is programmed to authenticate the substitutable functional portion at least prior to first execution thereof. 
         [0011]    A dishonest person might be tempted to use a substitutable functional portion in order to gain access to confidential information contained in the integrated circuit or in order to cause the processor unit to perform operations that are normally not allowed. Authenticating the substitutable functional portion makes it possible to verify that the substitutable functional portion was stored by an authorized person and is therefore, a priori, harmless. 
         [0012]    Under such circumstances, and advantageously, a signature is associated with the or each substitutable functional portion and the processor unit is programmed to verify the authenticity of the or each signature, and/or the substitutable functional portion is encrypted and authentication comprises a stage of decrypting and verifying padding bits. 
         [0013]    These authentication techniques are reliable and fast. 
         [0014]    The invention also provides a method of verifying a program contained in a ROM and executable by a processor unit of an integrated circuit, the program including functional portions, each associated with an identifier and an entry/exit point, and the method comprising the steps of: 
         [0015]    storing in the programmable ROM at least one substitutable functional portion suitable for substituting one of the functional portions of the ROM and associated with an identifier corresponding to the identifier of the corresponding functional portion of the ROM; and 
         [0016]    on execution of the program by the processor unit, executing the substitutable functional portion instead of the corresponding functional portion. 
         [0017]    Other characteristics and advantages of the invention appear on reading the following description of a particular, non-limiting embodiment of the invention. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWING 
         [0018]    Reference is made to the accompanying drawing, in which: 
           [0019]      FIG. 1  is a block diagram showing a smart card in accordance with the invention; 
           [0020]      FIG. 2  is a block diagram of the contents of the read-only memories of the card; and 
           [0021]      FIG. 3  is a block diagram of a substitutable functional portion used in the card. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0022]    With reference to the figures, the card in accordance with the invention comprises a body  1  having fastened thereto an integrated circuit given overall reference  2  and comprising a processor unit  3 , such as a processor, connected to a ROM  4 , a programmable ROM  5 , of the EEPROM type in this example, and a random access memory (RAM)  6 . The physical structure of the card in accordance with the invention is itself known. 
         [0023]    The ROM  4  contains an operating program given overall reference  7 , having a main module  10  and functional portions  8  (distinguished from one another by indices A, B, C, &amp; D), with entry/exit points  9  of the program being arranged therebetween (and individualized by indices A to E). 
         [0024]    Each functional portion  8  is associated with an identifier that is specific thereto. 
         [0025]    The term “operating program” is used to designate a program that, on being executed, enables the processor unit  3  to perform processing functions that correspond to each portion of the program making up a functional portion. The operating program may comprise portions providing basic operation of the processor unit (operating system) or application portions. The program may include functional modules that group together a plurality of functional portions. 
         [0026]    In known manner, the programmable ROM  5  contains optionally confidential data that is used by the processor unit when executing the operating program. The RAM  6  contains data received from the outside or for issuing to the outside, and also intermediate results of computations performed by the processor unit while executing the operating program. 
         [0027]    The programmable ROM  5  possesses a start  11  that contains a data block, given overall reference  12 , including substitutable functional portions  8 ′ (individualized by means of indices B and D) that are for replacing the functional portions  8 B and  8 D. The block  12  is stored in the form of a repetition of patterns comprising in succession: 
         [0028]    the identifier  13 B of the substitutable functional portion  8 ′B; 
         [0029]    an indication  14 B of the length of the data of the substitutable functional portion  8 ′B; 
         [0030]    the data  15 B in question; 
         [0031]    an integrity value calculated on the identifier  13 B, the indication  14 B, and the data  15 B (by way of example, the integrity value is the result of a cyclic redundancy check (CRC) type method); 
         [0032]    the identifier  13 D of the substitutable functional portion  8 ′D; 
         [0033]    an indication  14 D of the length of the data of the substitutable functional portion  8 ′D; 
         [0034]    the data  15 D in question; 
         [0035]    an end identifier  16 ; 
         [0036]    an indication  17  of the length of the end data; and 
         [0037]    the data in question incorporating in particular a signature, and optionally an acceleration indicator  19  and an integrity value. 
         [0038]    During execution of the operating program, the processor unit  3  verifies the presence in the programmable ROM  5  of an indicator  20  of the presence of substitutable functional portions  8 ′. Where appropriate, the processor unit  3  verifies, for each functional portion  8 , whether there exists a substitutable functional portion  8 ′, and if one does exist, it executes the substitutable functional portion instead of the corresponding functional portion  8 . 
         [0039]    The acceleration indicator  19  identifies the functional module in which the functional portion is to be replaced, thereby enabling execution of the program to be accelerated. 
         [0040]    Prior to execution of each functional portion, the identifiers of the substitutable functional portions  8 ′ are scanned and compared with the identifier of the functional portion that the processor unit  3  is preparing to execute. 
         [0041]    To execute the substitutable functional portions  8 ′, e.g. the substitutable functional portion  8 ′B, the processor unit exits the operating program via the entry/exit point  9 B that precedes the corresponding functional portion  8 B, and after executing the substitutable functional portion  8 ′B, returns to the operating program via the entry/exit point  9 C that follows the corresponding functional portion  8 B. 
         [0042]    Prior to executing the first substitutable functional portion  8 ′B, the processor unit  3  proceeds with an authentication step that consists in verifying the signature of the block  12  of substitutable functional portions  8 ′. If the signature is authenticated, the substitutable functional portions  8 ′ are executed normally. Otherwise, the processor unit  3  executes the original operating program  7 . In a variant, provision may be made for the processor unit  3  to issue a warning signal when the block  12  of substitutable functional portions  8 ′ is not authenticated. 
         [0043]    In addition, provision is preferably made to verify the integrity of the substitutable functional portions before executing them by using the integrity value  19  as calculated on the identifier  13 B, the indication  14 B, and the data  15 B. 
         [0044]    On each new execution of the operating program, the information of the start zone  11  where the block  12  of substitutable functional portions  8 ′ is stored and its signature are recovered by means of a dedicated command of the processor unit  3 . The response to this command may take the following forms: 
         [0045]    there is no substitutable functional portion, so the response may be constituted for example by a string of bytes having the value FF; 
         [0046]    there is a stored substitutable functional portion that has been validated, the response may then be constituted by the list of the functional portions that are to be replaced and the signature of the signature block; and 
         [0047]    there is a substitutable functional portion that has been loaded but not validated, with the response then being constituted, for example, by a string of bytes having the value 00. 
         [0048]    In the second circumstance, the signature is verified before executing the first substitutable functional portion  8 ′. 
         [0049]    The loading of the functional portions  8 ′ in the programmable ROM is described below. 
         [0050]    Prior to loading, the operator needs to be authenticated by means of a key. 
         [0051]    The block  12  of substitutable functional portions  8 ′ is communicated in encrypted form to the processor unit  3  for storing in the start zone  11  of the programmable ROM  5 . The processor unit  3  then performs a step of validating the block  12  of substitutable functional portions  8 ′. This validation step is performed by decrypting the block  12  of substitutable functional portions  8 ′ and by verifying that the padding bits match (bits used during encrypting). Verifying the padding bits enables the card to be sure that it is indeed the intended destination for the block  12 . Thereafter, the processor unit  3  verifies the signature and the integrity element in the block  12  of substitutable functional portions  8 ′. It should be observed that the signature itself may constitute the integrity element. By way of example, the integrity element may be obtained by the CRC method that consists in processing the data block as though it were a string of binary coefficients of a polynomial. 
         [0052]    If either of these two verifications fails, loading is interrupted and the block is invalidated, thereby making it unusable. Once the substitutable functional portions  8 ′ have been stored in the programmable ROM  5 , the size of the available memory is calculated and stored. The indicator that substitutable functional portions are present is updated in a determined zone of the programmable ROM  5 . 
         [0053]    When a substitutable functional portion  8 ′ becomes useless (e.g. if it is to be executed only a limited number of times), said substitutable functional portion may be deleted, e.g. by reloading a new block  12  of substitutable functional portions  8 ′ that does not contain the expired substitutable functional portion. It is also possible to erase all of the substitutable functional portions. 
         [0054]    Encrypting the block of substitutable functional portions is advantageous in particular when the manufacture and/or upgrading of cards is subcontracted to a supplier who also makes cards for competitors. Different decrypting codes maybe associated with each competitor so as to ensure that none of them can by accident or by evil intent gain access to the blocks of substitutable functional portions of their competitors. More generally, this also prevents third parties from gaining access to the content of a block of substitutable functional portions. 
         [0055]    Naturally, the invention is not limited to the embodiment described above, but on the contrary covers any variant using equivalent means to reproduce the essential characteristics set out above. 
         [0056]    In particular, the number and the format of the substitutable functional portions may be modified. The architecture of the block of substitutable functional portions may also be modified. 
         [0057]    In addition, other types of programmable ROMs may be used instead of an EEPROM, and in particular it is possible to use an erasable programmable memory (EPROM).