EP0919026A1 - Method for modifying code sequences and related device - Google Patents

Method for modifying code sequences and related device

Info

Publication number
EP0919026A1
EP0919026A1 EP98930843A EP98930843A EP0919026A1 EP 0919026 A1 EP0919026 A1 EP 0919026A1 EP 98930843 A EP98930843 A EP 98930843A EP 98930843 A EP98930843 A EP 98930843A EP 0919026 A1 EP0919026 A1 EP 0919026A1
Authority
EP
European Patent Office
Prior art keywords
program
sequence
memory
address
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
EP98930843A
Other languages
German (de)
French (fr)
Inventor
Azad Nassor
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CP8 Technologies SA
Original Assignee
Bull CP8 SA
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bull CP8 SA filed Critical Bull CP8 SA
Publication of EP0919026A1 publication Critical patent/EP0919026A1/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/32Address formation of the next instruction, e.g. by incrementing the instruction counter
    • G06F9/322Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address
    • G06F9/328Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address for runtime instruction patching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/66Updates of program code stored in read-only memory [ROM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/22Microcontrol or microprogram arrangements
    • G06F9/26Address formation of the next micro-instruction ; Microprogram storage or retrieval arrangements
    • G06F9/262Arrangements for next microinstruction selection
    • G06F9/268Microinstruction selection not based on processing results, e.g. interrupt, patch, first cycle store, diagnostic programs

Definitions

  • the present invention relates to a method for modifying code sequences and the associated device.
  • the present invention makes it possible to mask certain so-called sensitive operations carried out by the central unit.
  • the address windows [Adrdeb_i, Adrfin_1] are stored by increasing addresses, this facilitating the reading of the table. Consequently, the values located in the intervals] Adrfin_i, Adrdeb_i + 1 [are address values of the non-sensitive program.

Abstract

The invention concerns a device for modifying code sequences written in a medium memory (2) comprising a central unit (1), said memory containing a main programme executable by the central unit (1) which also comprises a second non-volatile programmable memory (3), and a third working memory.(4). The invention is characterised in that a rerouting table TAB_DER contained in the second programmable memory contains at least one field containing a new code sequence reference data, rerouting means for delayed rerouting of the executed code sequence towards the new code sequence written in one of the three memories and means in the new code sequence for returning to a point of the sequence before rerouting.

Description

PROCEDE DE MODIFICATION DE SEQUENCES DE CODE ET METHOD FOR MODIFYING CODE SEQUENCES AND
DISPOSITIF ASSOCIEASSOCIATED DEVICE
La présente invention concerne un procédé de modification de séquences de code et le dispositif associé.The present invention relates to a method for modifying code sequences and the associated device.
La présente invention concerne les programmes d'ordinateur et notamment ceux destinés à être enregistrés dans un support de façon non modifiable, du moins facilement. Ces supports sont intégrés dans un système informatique comprenant entre autres, une unité centrale, une mémoire de travail, une mémoire non volatile et des moyens d'entrée/sortie. Plus spécifiquement, ce système informatique peut être incorporé dans une carte à puce. Dans ce cas, la carte contient un circuit comportant au moins un microprocesseur, une mémoire morte contenant un programme et éventuellement des données, une mémoire de travail et une mémoire non volatile programmable. Avantageusement, le circuit est conçu sous une forme monolithique. La mémoire non volatile peut stocker des données et/ou du code ; ainsi, le microprocesseur peut exécuter ce code de la même façon que celui enregistré en mémoire morte. On trouve donc dans une carte deux types de mémoire ; le contenu de la première est inscrit dès la fabrication du circuit et non modifiable. Le contenu de la seconde est vierge au départ, les valeurs seront inscrites au cours de l'utilisation normale de l'objet.The present invention relates to computer programs and in particular those intended to be recorded in a medium that cannot be modified, at least easily. These media are integrated into a computer system comprising inter alia, a central processing unit, a working memory, a non-volatile memory and input / output means. More specifically, this computer system can be incorporated into a smart card. In this case, the card contains a circuit comprising at least one microprocessor, a read-only memory containing a program and possibly data, a working memory and a programmable non-volatile memory. Advantageously, the circuit is designed in a monolithic form. Non-volatile memory can store data and / or code; thus, the microprocessor can execute this code in the same way as that recorded in read-only memory. There are therefore two types of memory in a card; the content of the first is entered when the circuit is manufactured and cannot be modified. The content of the second is blank at the start, the values will be entered during the normal use of the object.
De nos jours, les cartes à puce peuvent répondre techniquement à de nombreux besoins. Le programme incorporé dans la carte, appelé aussi "système d'exploitation", permet d'adapter les fonctions de la carte à son usage final. Actuellement, le système d'exploitation est stocké dans une mémoire ROM qui est gravée lors de l'élaboration du circuit intégré. La modification du programme en vue de répondre à de nouveaux besoins est une opération longue qui pose un gros problème lorsque le client est pressé. De plus, cette opération est très coûteuse ; c'est pourquoi beaucoup de "petits" clients qui désireraient acheter quelques milliers de cartes sont découragés et souvent se contentent d'une carte qui ne répond que partiellement à leur attente. Une solution consisterait à utiliser un masque existant et à rajouter les fonctions que demande le client dans la mémoire programmable, ou à modifier celles existantes en ROM.Today, smart cards can technically meet many needs. The program incorporated in the card, also called "operating system", allows the functions of the card to be adapted to its end use. Currently, the operating system is stored in a ROM memory which is burned during the development of the integrated circuit. Modifying the program to meet new needs is a time-consuming process that poses a big problem when the customer is in a hurry. In addition, this operation is very expensive; this is why many "small" customers who would like to buy a few thousand cards are discouraged and often content themselves with a card that only partially meets their expectations. One solution would be to use an existing mask and add the functions requested by the client in the programmable memory, or to modify the existing ones in ROM.
La possibilité d'introduire et d'exécuter un code supplémentaire en mémoire programmable offre l'avantage de pouvoir facilement rajouter de nouvelles fonctions à un programme ancien ou d'adapter d'anciennes fonctions à des besoins spécifiques.The possibility of entering and executing an additional code in programmable memory offers the advantage of being able to easily add new functions to an old program or to adapt old functions to specific needs.
La demande de brevet FR 96/05454 de la demanderesse décrit un mécanisme particulier pour dérouter un programme lors de l'exécution de certaines instructions. La précédente invention consiste à établir à certains emplacements de la mémoire ROM, par des instructions respectives, des points d'interrogation et des points d'orientation. Un point d'interrogation est référencé par un numéro et permet d'accéder à une routine dans la mémoire programmable s'il existe une séquence de code correspondant à l'adresse indiquée par ce numéro. Dans l'affirmative, un drapeau est positionné et une adresse de déroutement est mémorisée en mémoire RAM. Un point d'orientation est actif si un point d'interrogation a préalablement été exécuté. Dans le cas favorable, le déroutement est déclenché en faisant effectuer au programme normal un saut à l'adresse programmée. La séquence de code à exécuter peut être en mémoire programmable ou en mémoire morte.Patent application FR 96/05454 of the applicant describes a particular mechanism for diverting a program during the execution of certain instructions. The previous invention consists in establishing at certain locations of the ROM memory, by respective instructions, question marks and orientation points. A question mark is referenced by a number and allows access to a routine in the programmable memory if there is a code sequence corresponding to the address indicated by this number. If so, a flag is set and a diversion address is stored in RAM memory. An orientation point is active if a question mark has previously been executed. In the favorable case, the diversion is triggered by making the normal program jump to the programmed address. The code sequence to be executed can be in programmable memory or in read-only memory.
Ce mode de réalisation comporte cependant plusieurs problèmes, si de nombreuses modifications dans le déroulement du programme doivent pouvoir être prises en compte. Dans ce dernier cas, il faut implémenter un grand nombre de points d'orientation dans la mémoire morte. A l'extrême limite, si l'on veut une grande adaptabilité, le programme contient plus de code permettant d'effectuer des déroutements que de code constituant le programme principal. La multiplicité de ces points est un inconvénient majeur si la taille de la mémoire morte est limitée. D'autre part, le temps d'exécution s'en trouve augmenté proportionnellement au nombre de points. Si on limite le nombre de points de déroutement pour tenir compte des contraintes, le mode de réalisation perd en souplesse, car il ne permet pas de dérouter un programme lors de l'exécution de n'importe quelle instruction.This embodiment has several problems, however, if numerous modifications in the course of the program must be able to be taken into account. In the latter case, a large number of orientation points must be implemented in the ROM. At the extreme limit, if one wants a great adaptability, the program contains more code allowing to carry out diversions than of code constituting the main program. The multiplicity of these points is a major drawback if the size of the read-only memory is limited. On the other hand, the execution time is increased in proportion to the number of points. If the number of diversion points is limited to take account of the constraints, the embodiment loses flexibility, since it does not make it possible to divert a program during the execution of any instruction.
La présente invention a pour objet un dispositif permettant de corriger certaines anomalies de fonctionnement d'un programme figé et permettre ainsi un déroulement correct, ou de rajouter facilement des fonctionnalités à un programme existant, tout en optimisant la séquence de code à écrire.The subject of the present invention is a device making it possible to correct certain operating anomalies in a frozen program and thus allow correct operation, or to easily add functionalities to an existing program, while optimizing the sequence of code to be written.
Ce but est atteint par le fait que le dispositif de modification de séquences de code inscrites dans une mémoire d'un support comprenant une unité centrale capable d'exécuter ces séquences de code, ladite mémoire contenant un programme principal exécutable par l'unité centrale qui comporte également une seconde mémoire programmable non volatile contenant éventuellement des nouvelles séquences de code exécutable, et une troisième mémoire de travail, est caractérisé en ce qu'une table de déroutement TAB_DER contenue dans la seconde mémoire programmable contient au moins un champ contenant une donnée de référence d'une nouvelle séquence de code, des moyens de déroutement permettant le déroutement différé de la séquence de code exécutée vers la nouvelle séquence de code inscrite dans une des trois mémoires et des moyens dans la nouvelle séquence de code permettant le retour en un point de la séquence de code exécutée avant le déroutement.This object is achieved by the fact that the device for modifying code sequences written in a memory of a medium comprising a central unit capable of executing these code sequences, said memory containing a main program executable by the central unit which also includes a second non-volatile programmable memory possibly containing new sequences of executable code, and a third working memory, is characterized in that a diversion table TAB_DER contained in the second programmable memory contains at least one field containing a datum of reference of a new code sequence, diversion means allowing the deferred diversion of the code sequence executed towards the new code sequence written in one of the three memories and means in the new code sequence allowing the return to a point of the code sequence executed before the diversion.
Selon un autre but, la présente invention peut interrompre le déroulement normal d'un programme avant l'exécution de n'importe quelle instruction, même avec un nombre de points d'orientation limité.According to another object, the present invention can interrupt the normal execution of a program before the execution of any instruction, even with a limited number of orientation points.
Ce but est atteint par le fait que les moyens de déroutement consistent en des instructions d'orientation (lORi) activables et implantées au préalable dans la mémoire contenant le code du programme principal, chaque instruction d'orientation étant associée à une référence i de la table de déroutement TAB_DER inscrite en mémoire programmable.This goal is achieved by the fact that the diversion means consist of orientation instructions (lORi) that can be activated and implemented. beforehand in the memory containing the code of the main program, each orientation instruction being associated with a reference i of the diversion table TAB_DER written in programmable memory.
Selon une autre particularité, chaque instruction d'orientation (lORi) activée déclenche l'exécution d'une séquence nouvelle de code comportant :According to another particular feature, each activated orientation instruction (lORi) triggers the execution of a new sequence of code comprising:
- des moyens de lire dans la table TAB_DER de la mémoire programmable un délai de temporisation ΔTi correspondant à la référence de l'instruction d'orientation, ce délai de temporisation permettant de différer le déclenchement d'une interruption qui effectue un branchement à une séquence nouvelle de code dont l'adresse (Adri) est indiquée dans la table, en association avec le délai de temporisation,means of reading from the table TAB_DER of the programmable memory a time delay ΔTi corresponding to the reference of the orientation instruction, this time delay making it possible to defer the triggering of an interruption which effects a connection to a sequence code news whose address (Adri) is indicated in the table, in association with the delay time,
- des moyens de mémoriser l'adresse (Adri) dans une mémoire du dispositif etmeans of memorizing the address (Adri) in a memory of the device and
- des moyens de lancer un compteur de temps du dispositif pour décompter le temps nécessaire au délai de temporisation du branchement.means of launching a time counter of the device to count down the time necessary for the delay time delay of the connection.
Selon un autre but, la présente invention permet de masquer certaines opérations dites sensibles effectuées par l'unité centrale.According to another object, the present invention makes it possible to mask certain so-called sensitive operations carried out by the central unit.
Ce but est atteint par le fait que le dispositif de modification de séquences de code comporte une seconde table TAB_SEC mémorisée dans la mémoire du dispositif et associant à chaque point (i) de déroutement un intervalle de temps [ΔTmini ; ΔTmaxi] associé au délai de temporisation ΔTi préalable à l'exécution d'une nouvelle séquence de code, et des moyens de vérification que le délai de temporisation est autorisé par l'intervalle de temps associé fourni par cette table.This object is achieved by the fact that the device for modifying code sequences comprises a second table TAB_SEC stored in the memory of the device and associating with each point (i) diversion a time interval [ΔTmini; ΔTmaxi] associated with the delay time ΔTi prior to the execution of a new code sequence, and means of verification that the delay time is authorized by the associated time interval provided by this table.
Selon une autre particularité, le dispositif de modification de séquences de code comporte des moyens permettant le décalage du délai ΔTi de temporisation de la valeur de l'intervalle de temps [ΔTmini ; ΔTmaxi]. Selon une autre particularité, le dispositif de séquences de code comporte des moyens de déclencher un message d'erreur lorsque le délai de temporisation ΔTi est dans l'intervalle de temps.According to another particular feature, the device for modifying code sequences comprises means allowing the delay ΔTi delay time delay to be offset by the value of the time interval [ΔTmini; ΔTmaxi]. According to another particular feature, the code sequence device comprises means for triggering an error message when the time delay ΔTi is in the time interval.
Selon une autre particularité, le dispositif de séquences de code comporte, consécutivement à la fin du délai de temporisation (ΔTi), lorsque le compteur atteint la valeur nulle, des moyens de déclencher une interruption, des moyens de mémorisation de la valeur actuelle d'un registre compteur programme PC dans une pile, puis des moyens de dérouter le programme à l'adresse définie dans la partie de la mémoire ROM contenant des vecteurs d'interruption, qui fournissent l'adresse du début de la séquence de code de l'interruption, des moyens de vérification que la valeur du registre compteur programme PC Val_PC mémorisée dans la pile n'est pas une valeur d'adresse de séquence sensible contenue dans une table TAB_SEC, et des moyens de modifier le déroulement des opérations. Selon une autre particularité, les moyens de vérification testent si la valeur du registre compteur programme est contenue par TAB_SEC dans l'intervalle [Adrdeb_i , Adrfin_1 ], correspondant à une interruption du programme pendant une séquence sensible et les moyens de modifier le déroulement des opérations de la carte renvoient un message indiquant que sa sécurité est atteinte et se bloque, soit les moyens de vérification testent si la valeur du registre compteur programme Val_PC est contenue dans l'intervalle ]Adrfin_i , Adrdeb_i+1 [ correspondant à une interruption du programme pendant une séquence non sensible et les moyens de modifier le déroulement des opérations autorisent le programme à exécuter alors la nouvelle séquence de code dont l'adresse de début a été mémorisée lors du traitement de l'instruction d'orientation (lORi).According to another particular feature, the code sequence device comprises, consecutively at the end of the time delay (ΔTi), when the counter reaches the zero value, means for triggering an interruption, means for memorizing the current value of a PC program counter register in a stack, then means for diverting the program to the address defined in the part of the ROM memory containing interrupt vectors, which provide the address of the start of the code sequence of the interruption, means of checking that the value of the PC program counter register Val_PC stored in the stack is not a sensitive sequence address value contained in a table TAB_SEC, and means of modifying the course of operations. According to another particular feature, the verification means test whether the value of the program counter register is contained by TAB_SEC in the interval [Adrdeb_i, Adrfin_1], corresponding to an interruption of the program during a sensitive sequence and the means of modifying the course of operations of the card return a message indicating that its security has been reached and is blocked, or the verification means test whether the value of the program counter register Val_PC is contained in the interval] Adrfin_i, Adrdeb_i + 1 [corresponding to an interruption of the program during a non-sensitive sequence and the means of modifying the flow of operations authorize the program to then execute the new code sequence, the start address of which has been stored during the processing of the orientation instruction (lORi).
Selon une autre particularité, le dispositif de modification de séquences de code comporte une source de fréquence pour le compteur différente d'une source de fréquence permettant à l'unité centrale d'exécuter le programme, la valeur du délai de temporisation (ΔTi) programmée dans la table de déroutement TAB_DER étant calculée pour permettre d'interrompre le programme à une adresse déterminée, la table TAB_DER comporte pour chaque valeur du délai de temporisation, un élément supplémentaire contenant cette adresse déterminée et des moyens de comparer l'adresse de l'instruction interrompue par l'interruption, à celle indiquée dans la table, et de provoquer une alarme.According to another particularity, the device for modifying code sequences comprises a frequency source for the counter different from a frequency source allowing the central unit to execute the program, the value of the programmed delay time (ΔTi) in the TAB_DER diversion table being calculated to allow the program to be interrupted at a determined address, the TAB_DER table comprises for each value of the timeout delay, an additional element containing this determined address and means for comparing the address of the interrupted instruction by the interruption, to that indicated in the table, and to cause an alarm.
Selon une autre particularité, le dispositif de séquences de code comporte des moyens de déclencher une alarme pour bloquer le support et indiquer une tentative de fraude par une écriture dans la mémoire.According to another particular feature, the code sequence device comprises means for triggering an alarm to block the medium and indicate an attempt at fraud by writing to the memory.
Selon une autre particularité, chaque séquence nouvelle de code se termine par une instruction d'orientation pour recharger le compteur avec une nouvelle valeur de délai de temporisation (ΔTi).According to another particular feature, each new sequence of code ends with an orientation instruction to reload the counter with a new time delay value (ΔTi).
Un dernier but est un procédé de modification de séquences de code figées inscrites dans un support comportant une unité centrale et une mémoire.A final object is a method of modifying frozen code sequences written in a medium comprising a central unit and a memory.
Ce but est atteint par le fait que le procédé de modification de séquences de code figées inscrites dans un support comportant une unité centrale et une mémoire consiste à prévoir dans au moins une séquence de code figée, au moins une instruction d'orientation (lORi), permettant de dérouter l'exécution par une interruption différée d'un délai de temporisation du programme contenu dans la mémoire de vers une adresse déterminée, par une table de déroutement TAB_DER, en fonction d'une référence i associée à l'instruction d'orientation et dans un délai de temporisation, déterminé par le contenu d'une ligne de table correspondant à la référence i de l'instruction d'orientation, une séquence nouvelle de code exécutable lors de l'interruption générée à la fin du délai de temporisation étant implantée à l'adresse contenue dans la table (TAB_DER).This object is achieved by the fact that the method for modifying frozen code sequences written in a medium comprising a central unit and a memory consists in providing in at least one fixed code sequence, at least one orientation instruction (lORi) , making it possible to divert the execution by a deferred interruption of a time delay of the program contained in the memory of towards a determined address, by a diversion table TAB_DER, according to a reference i associated with the instruction of orientation and within a time delay, determined by the content of a table row corresponding to the reference i of the orientation instruction, a new sequence of code executable during the interruption generated at the end of the time delay being located at the address contained in the table (TAB_DER).
Selon une autre particularité, une étape déclenchant l'interruption est précédée d'une étape de de vérification et le délai de temporisation n'est pas inclus dans un intervalle défini par une seconde table TAB_SEC dite sécuritaire inscrite dans la mémoire non volatile du support.According to another particular feature, a step triggering the interruption is preceded by a verification step and the delay time is not not included in an interval defined by a second table TAB_SEC called safe written in the non-volatile memory of the support.
D'autres caractéristiques et avantages de la présente invention apparaîtront plus clairement à la lecture de la description ci-après faite en référence aux dessins annexés dans lesquels :Other characteristics and advantages of the present invention will appear more clearly on reading the description below made with reference to the appended drawings in which:
la figure 1 représente une vue schématique des circuits électroniques nécessaire à la mise en oeuvre de la présente invention ;FIG. 1 represents a schematic view of the electronic circuits necessary for the implementation of the present invention;
la figure 2A représente le schéma temporel des séquences de code nécessaire à la mise en oeuvre de la présente invention ;FIG. 2A represents the time diagram of the code sequences necessary for the implementation of the present invention;
la figure 2B représente le logigramme de la séquence de code correspondant à l'activation d'un point de déroutement ;FIG. 2B represents the flow diagram of the code sequence corresponding to the activation of a diversion point;
la figure 2C représente la séquence de code correspondant au traitement de l'interruption générée par le compteur ;FIG. 2C represents the code sequence corresponding to the processing of the interrupt generated by the counter;
la figure 2D représente la table de déroutement TAB_DER ;figure 2D represents the diversion table TAB_DER;
la figure 3 représente un diagramme temporel de l'imbrication des séquences de code du programme d'application de traitement de l'instruction d'orientation et de traitement de l'interruption, dans un exemple d'application de l'invention ;FIG. 3 represents a time diagram of the nesting of the code sequences of the application program for processing the orientation instruction and for processing the interrupt, in an example of application of the invention;
la figure 4A représente la table de sécurité TAB_SEC ;FIG. 4A represents the security table TAB_SEC;
la figure 4B représente la modification du logigramme de la séquence de déroutement dans le cas d'une utilisation d'une table de sécurité conjointement avec la table de déroutement de l'invention.FIG. 4B represents the modification of the flow diagram of the diversion sequence in the case of the use of a security table jointly with the diversion table of the invention.
La figure 5 représente le logigramme du programme d'écriture dans la table de déroutement. La présente invention va maintenant être explicitée à l'aide d'un exemple qui se situe dans le domaine des "cartes à puce" et plus particulièrement des cartes à microprocesseurs. Ces cartes possèdent généralement un circuit intégré dont le schéma général est représenté dans la figure 1. Ce circuit dispose d'une Unité Centrale (1 ) reliée par un bus d'adresse et de donnée à une mémoire non volatile par exemple de type ROM (2), contenant le programme principal, une mémoire programmable non volatile de type EEPROM (3), une mémoire de travail RAM (4), une interface d'entrée/sortie I/O (5) et un compteur (6). Le compteur peut générer une interruption et interrompre ainsi le déroulement normal du programme exécuté par l'Unité Centrale L'interruption est associée à un vecteur. Ce dernier est l'adresse de début de la routine d'interruption. C'est l'adresse de la première instruction de la séquence qui gère l'interruption. De façon intégrée ou externe au compteur, un moyen d'inhibition de l'interruption permet de retarder et même d'annuler l'interruption. Celle-ci sera alors prise en compte plus tard ou pas du tout.FIG. 5 represents the flow diagram of the program for writing to the diversion table. The present invention will now be explained with the aid of an example which is in the field of "smart cards" and more particularly microprocessor cards. These cards generally have an integrated circuit, the general diagram of which is shown in FIG. 1. This circuit has a Central Unit (1) connected by an address and data bus to a non-volatile memory, for example of the ROM type ( 2), containing the main program, a non-volatile EEPROM type memory (3), a RAM working memory (4), an I / O input / output interface (5) and a counter (6). The counter can generate an interruption and thus interrupt the normal course of the program executed by the Central Unit. The interruption is associated with a vector. The latter is the start address of the interrupt routine. It is the address of the first instruction in the sequence which manages the interrupt. Integrated or external to the counter, a means of inhibiting the interruption makes it possible to delay and even cancel the interruption. This will then be taken into account later or not at all.
La mémoire programmable (3) est divisée en plusieurs parties. Une première partie, appelée zone système, contient des informations systèmes non lisibles de l'extérieur, cette partie contient notamment les valeurs des pointeurs permettant de délimiter chacune des autres parties de la mémoire. Une seconde partie (32) est notée zone de donnée, elle est accessible de l'extérieur et contient principalement les données utilisateurs. Une troisième partie (33) contient une table d'orientation TAB_DER, cette table contient des éléments aux formats identiques composés d'au moins trois champs (N°Réf, ΔTi et Adri). Une quatrième partie (34), notée zone de séquences, contient les séquences de code pouvant être appelées par le programme principal à partir des numéros de référence (N°Réf) du point d'orientation et de l'adresse (Adri) lue dans la table. Il est à noter que dans une variante de l'invention, la table d'orientation, ou une ou plusieurs séquences de code, peuvent être chargées en mémoire de travail RAM plutôt qu'en mémoire programmable non volatile.The programmable memory (3) is divided into several parts. A first part, called the system area, contains system information that cannot be read from the outside, this part notably contains the values of the pointers making it possible to delimit each of the other parts of the memory. A second part (32) is denoted data area, it is accessible from the outside and mainly contains user data. A third part (33) contains an orientation table TAB_DER, this table contains elements with identical formats composed of at least three fields (Ref No., ΔTi and Adri). A fourth part (34), denoted sequence zone, contains the code sequences which can be called by the main program from the reference numbers (Ref No.) of the orientation point and the address (Adri) read in Table. It should be noted that in a variant of the invention, the orientation table, or one or more code sequences, can be loaded into RAM working memory rather than non-volatile programmable memory.
L'adresse de début, appelée AD_TAB, de la table d'orientationThe start address, called AD_TAB, of the orientation table
TAB_DER est mémorisée dans la zone système (31 ). Un emplacement précis est prévu pour contenir cette valeur. L'écriture effective de cet emplacement constitue en soi l'indication que la table est bien présente et que les points d'orientation peuvent être opérationnels.TAB_DER is stored in the system area (31). A specific location is provided to contain this value. The actual writing of this location constitutes in itself an indication that the table is present and that the orientation points can be operational.
La mémoire ROM(2) qui contient, entre autres, le programme principal, est divisée en trois parties. La première (21 ) réalise l'initialisation du programme lors d'une mise sous tension. La seconde partie (22) contient le programme d'application. La troisième partie (23) contient du codeThe ROM memory (2) which contains, among other things, the main program, is divided into three parts. The first (21) performs the initialization of the program upon power up. The second part (22) contains the application program. The third part (23) contains code
"dormant" dont le rôle est expliqué par la suite."dormant" whose role is explained below.
Lorsque le programme arrive à un point de déroutement ou d'orientation (220), il exécute une séquence de déroutement représentée à la figure 2B, laquelle consiste en une première étape dans laquelle le programme examine si une interruption est déjà en cours. Dans le cas affirmatif, le programme est avorté. Dans le cas négatif, le programme se poursuit par l'étape 2202, à laquelle il examine si un indicateur correspondant au point de déroutement i est actif.When the program arrives at a diversion or orientation point (220), it executes a diversion sequence shown in Figure 2B, which consists of a first step in which the program examines whether an interruption is already in progress. If so, the program is aborted. In the negative case, the program continues with step 2202, in which it examines whether an indicator corresponding to the diversion point i is active.
Dans la négative, le programme fait un traitement d'erreur du type décrit dans la demande précédente. Dans l'affirmative, le programme se poursuit par l'étape de recherche dans la table TAB_DER inscrite dans la troisième partie (33) de la mémoire EEPROM, la valeur (ΔTi) de programmation du compteur correspondant au déroutement i et l'adresse de saut (Adrsi).If not, the program performs an error treatment of the type described in the previous request. In the affirmative, the program continues with the step of searching in the table TAB_DER written in the third part (33) of the EEPROM memory, the value (ΔTi) for programming the counter corresponding to the diversion i and the address of jump (Adrsi).
L'étape suivante 2205 permet le chargement du compteur de temporisation (6) avec la valeur (ΔTi) de temporisation donnée par la ligne i de la table TAB_DER. Puis l'étape suivante du programme 2206 permet le lancement du compteur de temporisation. Sur certains microprocesseurs l'écriture d'une nouvelle valeur dans le compteur entraîne son activation, et dans ce cas les deux étapes 2205 et 2206 sont confondues. Après cette étape, la séquence de déroutement se rebranche par l'étape 2207 à l'instruction suivante du programme qu'elle était en train d'exécuter lorsqu'elle a rencontré une instruction (IOR) de déroutement ou d'orientation, matérialisant un point de déroutement.The next step 2205 allows the loading of the time counter (6) with the time value (ΔTi) given by line i of the table TAB_DER. Then the next step of program 2206 allows the launch of the timer. On certain microprocessors the writing of a new value in the counter causes its activation, and in this case the two steps 2205 and 2206 are confused. After this step, the diversion sequence is reconnected by step 2207 to the next instruction of the program that it was executing when it encountered a diversion or orientation instruction (IOR), materializing a diversion point.
Lorsque le compteur, lancé à l'étape 2206, a écoulé le temps (ΔTi) fourni par la ligne i de la table TAB_DER, le compteur (6) déclenche sur le microprocesseur (1 ) une interruption qui donne lieu au traitement d'une séquence d'interruption (221 ; figure 2A). Cette séquence d'interruption, dont le détail est donné à la figure 2C, commence par une étape d'empilement éventuel du contexte de saut (2210) dans la mémoire RAM(4). Puis le traitement de l'interruption se poursuit par une étape (2211 ) d'exécution de la nouvelle séquence de code contenue, soit dans la quatrième partie (34) de l'EEPROM(3), soit dans la troisième partie (23) de la ROM, à l'adresse mémorisée précédemment à l'étape 2204. Puis l'interruption se termine par l'étape (2212) d'utilisation éventuelle du contexte empilé pour revenir au programme principal, soit à l'instruction suivante (2212A) de celle exécutée avant l'interruption en utilisant, par exemple, une instruction RTI de retour d'interruption, soit en faisant un saut (par exemple, par une instruction JUMP), comme représenté par la référence 2212B de la figure 2A.When the counter, launched in step 2206, has elapsed the time (ΔTi) provided by line i of the table TAB_DER, the counter (6) triggers on the microprocessor (1) an interruption which gives rise to the processing of a interrupt sequence (221; Figure 2A). This interruption sequence, the details of which are given in FIG. 2C, begins with a step of possibly stacking the jump context (2210) in the RAM memory (4). Then the processing of the interruption continues with a step (2211) of execution of the new code sequence contained, either in the fourth part (34) of the EEPROM (3), or in the third part (23) ROM, at the address previously stored in step 2204. Then the interruption ends with step (2212) of possible use of the stacked context to return to the main program, that is to say to the following instruction (2212A ) of that executed before the interruption by using, for example, an instruction RTI of return of interruption, either by making a jump (for example, by a JUMP instruction), as represented by the reference 2212B of FIG. 2A.
On comprend ainsi que par l'enregistrement d'une table dans l'EEPROM, d'une séquence d'interruption dans la ROM et d'une séquence de déroutement dans une mémoire volatile ou non, on peut intervenir en tout point du programme d'application mémorisé dans la ROM, et modifier ou ajouter des fonctionnalités nouvelles par la mise en oeuvre des parties de code dormant, ou de nouvelles parties de code inscrites en EEPROM par exemple. Le point d'orientation existait avant la partie de programme que l'on veut maintenant modifier. Ce point d'orientation est doté d'un numéro de référence qui lui est propre, dans le cas présent "1".It is thus understood that by recording a table in the EEPROM, an interrupt sequence in the ROM and a diversion sequence in a volatile memory or not, it is possible to intervene at any point of the program d application stored in the ROM, and modify or add new functionalities by the implementation of the parts of dormant code, or of new parts of code registered in EEPROM for example. The orientation point existed before the program part which we now want to modify. This orientation point has its own reference number, in this case "1".
La table TAB_DER a été introduite en mémoire programmable et l'entrée correspondant au numéro de référence « 1 » renseigné de la façon suivante par exemple :The TAB_DER table has been entered in programmable memory and the entry corresponding to the reference number "1" is filled in as follows for example:
ΔT1 a été calculée pour que cela corresponde à la durée nécessaire pour interrompre le déroulement du programme principal à l'adresse désirée Adr_2 (figure 3). Pour faire ce calcul, on prend en compte le nombre d'instructions pour « atteindre » l'adresse Adr_2 et la fréquence de décompte du compteur.ΔT1 has been calculated so that it corresponds to the time necessary to interrupt the running of the main program at the desired address Adr_2 (Figure 3). To make this calculation, we take into account the number of instructions to "reach" the address Adr_2 and the counting frequency of the counter.
Dans un premier temps, la présence de la table d'orientation est testée. On a dit précédemment que cela peut revenir à tester l'écriture ou non de l'emplacement contenant l'adresse de début de la table TAB_DER. Ensuite, la présence d'une interruption en cours du compteur est testée. Si le compteur est en cours, il faut interdire l'exécution du point de déroutement, seule la séquence de code correspondant à un précédent point d'orientation sera exécutée. Sinon, le programme recherche les valeurs écrites dans les deuxième et troisième éléments correspondant au point d'orientation numéro 1. Les valeurs ΔT1 et Adr_1 sont extraites respectivement du premier et second champ de l'élément. Le registre de donnée du compteur est alors chargé avec la valeur ΔT1 et, le vecteur d'interruption associé à l'interruption provoquée par le compteur est chargé avec la valeur Adr _1. Enfin, juste avant de sortir de la séquence du point d'orientation, le compteur est lancé et la valeur stockée dans son registre de donnée décroît en fonction du temps. La valeur ΔT1 doit être déterminée avec une grande précision, elle dépend directement du nombre de cycles qui sépare le moment des exécutions de l'instruction de lancement du compteur et de la première instruction que l'on ne veut pas exécuter. Si le compteur est synchronisé avec l'horloge de l'Unité Centrale, il suffit d'additionner le nombre de cycles de chacune des instructions séparant les deux instructions précédemment nommées. Si le compteur n'est pas synchronisé avec la même fréquence que l'U.C. le calcul étant approximatif est délicat.First, the presence of the orientation table is tested. We said earlier that this can be equivalent to testing whether or not the location containing the start address of the table TAB_DER has been written. Then, the presence of an interruption in progress of the counter is tested. If the counter is in progress, the execution of the diversion point must be prohibited, only the code sequence corresponding to a previous orientation point will be executed. Otherwise, the program searches for the values written in the second and third elements corresponding to orientation point number 1. The values ΔT1 and Adr_1 are extracted respectively from the first and second fields of the element. The data register of the counter is then loaded with the value ΔT1 and, the interruption vector associated with the interruption caused by the counter is loaded with the value Adr _1. Finally, just before leaving the orientation point sequence, the counter is started and the value stored in its data register decreases as a function of time. The value ΔT1 must be determined with great precision, it depends directly on the number of cycles which separates the moment of the executions of the instruction to start the counter and the first instruction that one does not want to execute. If the counter is synchronized with the clock of the Central Unit, it suffices to add the number of cycles of each of the instructions separating the two previously named instructions. If the counter is not synchronized with the same frequency as the CPU, the approximate calculation is difficult.
Si la source de fréquence du compteur est différente de celle permettant de dérouler le programme, alors le procédé de l'invention permet d'effectuer par exemple une tâche contrôle sécuritaire. En effet, les valeurs programmées dans la table TAB_DER permettent d'interrompre à une adresse déterminée, laquelle adresse a été indiquée comme élément supplémentaire dans la table TAB_DER, et une fois l'interruption active, on peut comparer l'adresse de l'instruction interrompue à celle indiquée dans la table. Si elles ne sont pas égales, alors on peut conclure qu'il y a un dérèglement des sources de fréquence, dû peut être à une tentative de fraude, et le programme peut agir de la façon qui convient (en se bloquant par exemple).If the frequency source of the counter is different from that allowing the program to run, then the method of the invention makes it possible, for example, to perform a safety control task. Indeed, the values programmed in the table TAB_DER make it possible to interrupt at a determined address, which address has been indicated as an additional element in the table TAB_DER, and once the interruption active, we can compare the address of the instruction interrupted to that indicated in the table. If they are not equal, then we can conclude that there is a disruption of the frequency sources, perhaps due to an attempt at fraud, and the program can act in the appropriate way (by blocking for example).
Une façon préférée de réaliser l'invention consiste à élaborer une table (figure 2D) en mémoire programmable, le premier élément de cette table est le numéro de référence du point d'orientation, le second élément est une valeur de chargement du compteur et, le troisième élément est l'adresse de la séquence de code à exécuter.A preferred way of implementing the invention consists in developing a table (FIG. 2D) in programmable memory, the first element of this table is the reference number of the orientation point, the second element is a counter loading value and, the third element is the address of the code sequence to be executed.
Cette table (figure 2D) possède une taille maximale de 30 octets répartis en 6 lignes de 5 octets. Le premier élément de la table comprend un octet, ce qui permet d'installer dans le code ROM, 255 points d'orientation, numérotés de 1 à 255. La valeur zéro indique qu'il n'y a plus de valeur et la fin de table est alors atteinte. La seconde valeur s'exprime sur deux octets, ce qui autorise 65536 valeurs différentes de chargement du compteur. Enfin, l'adresse de saut est notée sur deux octets, valeur traditionnelle pour des microprocesseurs de type carte à puce. Cette adresse doit permettre de faire exécuter des séquences de codes écrites en mémoire programmable EEPROM aussi bien que du code en ROM (code dormant).This table (Figure 2D) has a maximum size of 30 bytes divided into 6 lines of 5 bytes. The first element of the table includes a byte, which allows to install in the ROM code, 255 orientation points, numbered from 1 to 255. The value zero indicates that there is no more value and the end table is reached. The second value is expressed in two bytes, which authorizes 65536 different counter loading values. Finally, the jump address is noted on two bytes, a traditional value for chip card type microprocessors. This address must make it possible to execute sequences of codes written in EEPROM programmable memory as well as code in ROM (dormant code).
On peut remarquer que la sixième ligne de cette table TAB_DER (figure 2D) est à "00", il n'y a donc, dans le cas présent que 5 points d'orientation opérationnels : Les n°1 ,3 4 (2 entrées) et 6. Les points d'orientation 3 et 6 ont la même adresse de saut Adr_3, ce qui veut dire que la modification de programme est la même pour ces deux points. Trois séquences de déroutement sont donc prévues. Ces séquences de déroutement peuvent être mémorisées dans la mémoire programmable et dans une partie du code ROM, ce code "dormant" pouvant être ainsi exécuté à l'aide des points d'orientation.We can notice that the sixth line of this table TAB_DER (figure 2D) is at "00", there are therefore, in this case only 5 operational orientation points: The n ° 1, 3 4 (2 entries ) and 6. Orientation points 3 and 6 have the same jump address Adr_3, which means that the program modification is the same for these two points. Three diversion sequences are therefore planned. These rerouting sequences can be stored in the programmable memory and in a part of the ROM code, this "dormant" code can thus be executed using the orientation points.
Une autre façon de gérer la table d'orientation, qui évite au programmeur de prévoir en mémoire une information correspondant à la taille de la table, consiste à prévoir un champ supplémentaire, qui contient la valeur d'adresse de l'élément suivant de la table d'orientation. Pour plus de détails, on pourra se référer à la demande de brevet référencée plus haut.Another way to manage the orientation table, which avoids the programmer having to store in memory information corresponding to the size of the table, consists in providing an additional field, which contains the address value of the next element of the orientation table. For more details, reference may be made to the patent application referenced above.
Avantageusement, une séquence nouvelle de code peut se terminer par un point d'orientation ce qui permet de recharger le compteur et donc de rajouter une nouvelle temporisation, comme le montre le tableau précédent pour le numéro de référence « 4 ». Cela est particulièrement utile pour réaliser des temporisations très longues qui dépassent la capacité du compteur. On implemente alors dans la séquence de code, la gestion d'un compteur d'interruption qui est initialisé à une certaine valeur de départ, cette valeur représente le nombre de temporisations maximales à effectuer avant de programmer dans le compteur du temporisateur la valeur inscrite dans TAB_DER. A la suite de cette dernière temporisation, la partie de la séquence de code relative à la modification du programme principal est exécutéeAdvantageously, a new code sequence can end with an orientation point which makes it possible to reload the counter and therefore to add a new time delay, as shown in the previous table for the reference number "4". This is particularly useful for making very long timers that exceed the capacity of the counter. We then implement in the code sequence, the management of an interrupt counter which is initialized at a certain starting value, this value represents the number of maximum time delays to be carried out before programming in the timer counter the value entered in TAB_DER. Following this last delay, the part of the code sequence relating to the modification of the main program is executed
Un exemple d'application de l'invention est représenté à la figure 3, dans laquelle un programme d'application écrit en mémoire ROM peut contenir un certain nombre d'instructions d'interrogation (Ni), SUIVI de séquences de code les séparant de l'instruction d'orientation (IOI) correspondante, selon le principe de la demande de brevet français n° 96/05454 déposée par la demanderesseAn example of application of the invention is represented in FIG. 3, in which an application program written in ROM memory can contain a certain number of interrogation instructions (Ni), FOLLOWED by code sequences separating them from the corresponding orientation instruction (IOI), according to the principle of French patent application No. 96/05454 filed by the applicant
Ces instructions d'interrogation (Ni) permettent de déterminer si l'instruction d'orientation (lORi) correspondante est active ou non, et dans le cas où elle est active, lorsque le programme arrive sur l'instruction d'orientation, de dérouter le programme vers un point d'orientation (i) ou déroutement, dont le numéro de référence pour l'instruction d'orientation (IOi) est iThese interrogation instructions (Ni) make it possible to determine whether the corresponding orientation instruction (lORi) is active or not, and if it is active, when the program arrives at the orientation instruction, to divert the program to an orientation point (i) or diversion, whose reference number for the orientation instruction (IOi) is i
L'exécution de l'instruction d'orientation (lORi) déclenche plusieurs opérations Elle déclenche d'abord la lecture de la table de dérivation ou de déroutement TAB_DER inscrite dans la zone 33 de la mémoire EEPROM pour déterminer si, à l'adresse i de cette table, les valeurs ΔT1 de compteur et d'adresse (Adri) de saut ont été remplies et dans le cas où ces valeurs sont présentes, les informations correspondantes ΔTi valeur de compteur et Adri adresse de saut, sont mémorisées temporairement, par exemple, dans la mémoire RAM(4) Puis, l'instruction d'orientation se termine par le lancement du compteur de temps 6The execution of the orientation instruction (lORi) triggers several operations. It first triggers the reading of the derivation or diversion table TAB_DER written in area 33 of the EEPROM memory to determine whether, at address i from this table, the values ΔT1 of counter and jump address (Adri) have been filled and in the case where these values are present, the corresponding information ΔTi counter value and Adri jump address, are temporarily stored, for example , in the RAM memory (4) Then, the orientation instruction ends with the launching of the time counter 6
Une fois l'instruction d'orientation exécutée, le programme d'application continue à dérouler sa séquence dans l'ordre, arrive à l'exécution de l'instruction repérée par l'adresse Adr_1 correspondant à l'exemple de code exécutable figurant en annexe 1 , exécute la série d'instruction de cette séquence, puis arrive à l'instruction repérée par l'adresse Adr_2, pour laquelle on a choisi de modifier la valeur correspondante utilisée dans l'opération ultérieure de l'instruction de la séquence du programme normalement enregistré en mémoire ROM par une autre valeur. Pour cela on détermine ΔT1 de façon que l'interruption se produise avant que le programme exécute l'instruction de l'adresse (Adr_2) et l'interruption déroute le programme vers une séquence de code à l'adresse Adri. Ainsi, dans l'exemple donné du programme de l'annexe 1 , on veut remplacer la valeur 10 par la valeur 20 dans la multiplication qui est effectuée ensuite à l'adresse Adr_3.Once the orientation instruction has been executed, the application program continues to run its sequence in order, arrives at the execution of the instruction identified by the address Adr_1 corresponding to the example of executable code appearing in appendix 1, executes the instruction series of this sequence, then arrives at the instruction identified by the address Adr_2, for which we chose to modify the value corresponding value used in the subsequent operation of the instruction of the sequence of the program normally saved in ROM memory by another value. For this, ΔT1 is determined so that the interruption occurs before the program executes the instruction of the address (Adr_2) and the interruption routs the program to a code sequence at the address Adri. Thus, in the example given in the program of appendix 1, we want to replace the value 10 by the value 20 in the multiplication which is then carried out at the address Adr_3.
Ceci est obtenu par la séquence de code figurant à l'annexe 2. On conçoit ainsi que l'accumulateur B a été chargé avec la valeur 20 à la place de la valeur 10, ce qui va changer le résultat de la multiplication sans avoir à modifier le programme inscrit en ROM.This is obtained by the code sequence appearing in appendix 2. It is thus conceived that the accumulator B was charged with the value 20 instead of the value 10, which will change the result of the multiplication without having to modify the program written in ROM.
Ainsi par des inscriptions de séquences nouvelles de code en EEPROM dans la zone 34, comme celle représentée à la figure 3, dans le carré 341 , par l'inscription d'une table de déroutement TAB_DER dans la zone 33 de l'EEPROM (3) et, par la mise en place d'instructions d'orientation dans le programme d'exploitation (Operating System) mémorisé dans la ROM de la carte à puce, on va pouvoir intervenir et modifier à volonté toutes les instructions par le choix de la temporisation ΔTi et de l'adresse d'intervention Adri, à laquelle va se trouver la nouvelle séquence de code inscrite dans une des mémoires de la carte.Thus by inscriptions of new sequences of code in EEPROM in the area 34, like that represented in figure 3, in the square 341, by the inscription of a diversion table TAB_DER in the area 33 of the EEPROM (3 ) and, by setting up orientation instructions in the operating system (Operating System) stored in the ROM of the smart card, we will be able to intervene and modify all the instructions at will by choosing the time delay ΔTi and of the intervention address Adri, at which the new code sequence written in one of the card memories will be found.
Le début de cette partie de programme de l'annexe 1 comporte l'appel à un point d'orientation, numéroté "01 ". Des instructions existent ensuite. Puis, une séquence particulière est décrite. Tout d'abord, la valeur de l'octet pointé par X est multipliée par la valeur 10, le résultat sur deux octets est stocké dans deux registres, puis le sous-programme d'écriture en mémoire programmable est exécuté. Le programme étant figé en ROM il n'est plus modifiable, or il s'avère que la valeur "10" doit être changée en "20". Nous allons maintenant décrire comment la présente invention peut résoudre ce problème.The beginning of this part of the program in appendix 1 includes the call for an orientation point, numbered "01". Instructions then exist. Then, a particular sequence is described. First, the value of the byte pointed by X is multiplied by the value 10, the result on two bytes is stored in two registers, then the subroutine for writing in programmable memory is executed. The program being frozen in ROM, it can no longer be modified, but it turns out that the value "10" must be changed to "20". We We will now describe how the present invention can solve this problem.
L'Unité Centrale continue alors l'exécution du programme principal (PP ; figure 3). Au moment où le microprocesseur va lancer l'exécution de l'instruction de l'adresse notée adr_2, le registre de donnée du compteur (6) initialisé au point de déroutement avec la valeur ΔTi, atteint la valeur nulle, ce qui déclenche une interruption (IT ; figure 3) qui permet le branchement de l'adresse Adri. L'instruction "LDB #01 Od" n'est donc pas exécutée. L'Unité Centrale est déroutée vers l'adresse Adri où l'on trouve la séquence de code qui figure en annexe 2 :The Central Unit then continues the execution of the main program (PP; figure 3). When the microprocessor will start the execution of the instruction of the address noted adr_2, the data register of the counter (6) initialized at the diversion point with the value ΔTi, reaches the value zero, which triggers an interruption (IT; figure 3) which allows the connection of the Adri address. The instruction "LDB # 01 Od" is therefore not executed. The Central Unit is diverted to the Adri address where we find the code sequence which appears in appendix 2:
Cette petite séquence de code décrite dans l'annexe 2 permet de charger la valeur "20" dans le registre B qui sert à la multiplication, puis de revenir dans le programme principal, c'est à dire l'adresse adr_3, immédiatement après l'instruction que l'on veut modifier ou ne pas exécuter. L'instruction de multiplication à cette adresse prend en compte non plus la valeur "10" contenue à l'instruction précédente dans le code ROM, mais la valeur "20" contenue dans la nouvelle séquence de code.This small code sequence described in appendix 2 makes it possible to load the value "20" in the register B which is used for the multiplication, then to return in the main program, ie the address adr_3, immediately after l instruction that you want to modify or not execute. The multiplication instruction at this address no longer takes into account the value "10" contained in the previous instruction in the ROM code, but the value "20" contained in the new code sequence.
La variante de l'invention ci-après prend en compte les besoins sécuritaires. Pour des raisons sécuritaires, il peut être important de ne pouvoir arrêter l'exécution d'une partie de programme par une interruption. C'est le cas par exemple d'une authentification avec calcul cryptographique et comparaison entre des valeurs reçues et calculées. Ainsi, tant que la clé secrète est en mémoire de travail et donc visible par une séquence de déroutement, il ne faut pas autoriser d'interruptions. Ceci est possible en inhibant au cours de l'exécution d'un programme "sensible" toutes les interruptions ou au moins celles du compteur.The variant of the invention below takes into account security needs. For security reasons, it may be important not to be able to stop the execution of a part of a program by an interrupt. This is the case for example of an authentication with cryptographic calculation and comparison between received and calculated values. Thus, as long as the secret key is in working memory and therefore visible by a diversion sequence, you must not authorize interruptions. This is possible by inhibiting during the execution of a "sensitive" program all the interruptions or at least those of the counter.
L'inhibition des interruptions et leur réactivation s'effectuent chacune par une instruction interprétable par la quasi totalité des microprocesseurs. Ces instructions modifient généralement un bit du registre d'état du microprocesseur qui, tant qu'il est actif, empêche le déclenchement de l'interruption, et tant qu'il est inactif, autorise les interruptions. La présence d'une instruction d'inhibition d'interruption en mémoire ROM avant une séquence sensible a pour conséquence que la séquence sensible est définitivement protégée si l'instruction de réactivation est placée après la séquence sensible.The inhibition of interruptions and their reactivation are each carried out by an instruction interpretable by almost all of the microprocessors. These instructions generally modify a bit of the status register of the microprocessor which, as long as it is active, prevents the triggering of the interrupt, and as long as it is inactive, authorizes the interruptions. The presence of an instruction to inhibit interruption in ROM memory before a sensitive sequence has the consequence that the sensitive sequence is definitively protected if the reactivation instruction is placed after the sensitive sequence.
Une autre méthode pour interdire le déclenchement des interruptions lors de l'exécution d'une séquence sensible est de tester, lors de l'exploitation de la table TAB_DER, et ceci pour chaque point d'orientation, la valeur de programmation du timer. Une table TAB_SEC est donc prévue en mémoire ROM ou en mémoire E2PROM verrouillée qui comprend pour chaque point d'orientation du programme principal, un couple de valeur [Δ Tmini, ΔTmaxi] définissant un intervalle dans lequel toute valeur de programmation du compteur est interdite. Avantageusement, la table TAB_SEC peut comprendre plusieurs couples [ΔTmini, ΔTmaxi] pour le même point d'orientation, comme représenté à la figure 4A.Another method to prohibit the triggering of interruptions during the execution of a sensitive sequence is to test, during the exploitation of the table TAB_DER, and this for each orientation point, the programming value of the timer. A TAB_SEC table is therefore provided in ROM memory or in locked E 2 PROM memory which includes for each orientation point of the main program, a value pair [Δ Tmini, ΔTmaxi] defining an interval in which any programming value of the counter is prohibited. Advantageously, the table TAB_SEC can include several couples [ΔTmini, ΔTmaxi] for the same orientation point, as shown in FIG. 4A.
La présence de la table TAB_SEC en ROM fige les séquences sensibles, comme précédemment, alors que la présence en E2PROM permet de modifier les zones de séquence sensible jusqu'au verrouillage par une clé.The presence of the table TAB_SEC in ROM freezes the sensitive sequences, as before, while the presence in E 2 PROM makes it possible to modify the zones of sensitive sequence until locking by a key.
Pour les points d'orientation 3 et 5, deux intervalles de temps sont programmés.For orientation points 3 and 5, two time intervals are programmed.
Lors de l'exploitation des informations dans la table TAB_DER, le système d'exploitation teste si la valeur ΔTi à écrire correspondant au point d'orientation i n'appartient pas à des intervalles [ΔTmini, ΔTmaxi]. Si c'est le cas, une séquence sensible serait interrompue, cela étant interdit, le système d'exploitation refuse l'écriture et renvoie un message d'erreur. Si par contre, correspondant à ce point d'orientation, la valeur ΔTi n'est pas incluse dans l'intervalle de temps non autorisé, l'écriture est menée à bien et le point d'orientation devient opérationnel.When processing the information in the TAB_DER table, the operating system tests whether the value ΔTi to be written corresponding to the orientation point i does not belong to intervals [ΔTmini, ΔTmaxi]. If this is the case, a sensitive sequence would be interrupted, this being prohibited, the operating system refuses to write and returns an error message. If on the other hand, corresponding to this orientation point, the value ΔTi is not included in the unauthorized time interval, the writing is carried out and the orientation point becomes operational.
Dans la variante où on utilise une table sécuritaire TAB_SEC, la séquence de déroutement correspond à la figure 4B. Cette séquence comporte, outre les étapes de la figure 2B, les étapes suivantes, ajoutées entre l'étape 2204 et l'étape 2205 de la figure 2B :In the variant where a security table TAB_SEC is used, the diversion sequence corresponds to FIG. 4B. This sequence comprises, in addition to the steps of FIG. 2B, the following steps, added between step 2204 and step 2205 of FIG. 2B:
- une première étape 22041 , qui consiste à lire la table de sécurité TAB_SEC à la ligne i pour déterminer l'intervalle [ΔTmini, ΔTmaxi], et vérifier, par exemple, que la valeur ΔTi d'initialisation du compteur de temporisation n'est pas incluse dans cet intervallef ΔTmaxi, ΔTmini]. La logique opposée est également possible. Si la valeur ΔTi n'est pas incluse, on poursuit par l'étape 2205. Si la valeur (ΔTi) est incluse, on poursuit, soit par l'étape 22043A qui permet l'affichage d'un message d'erreur, soit par l'étape 22043B, qui exécute une instruction permettant de recharger le timer avec la valeur (ΔTi) augmentée de l'intervalle. Ceci diffère le déclenchement de l'interruption de la longueur de l'intervalle.a first step 22041, which consists in reading the security table TAB_SEC in line i to determine the interval [ΔTmini, ΔTmaxi], and to verify, for example, that the value ΔTi of initialization of the time counter is not not included in this interval f ΔTmaxi, ΔTmini]. The opposite logic is also possible. If the value ΔTi is not included, we continue with step 2205. If the value (ΔTi) is included, we continue either with step 22043A which allows the display of an error message, or by step 22043B, which executes an instruction making it possible to reload the timer with the value (ΔTi) increased by the interval. This differs from triggering the interrupt in the length of the interval.
Cette dernière variante permet malgré tout de déclencher les interruptions, mais de ne pas pouvoir intervenir sur des séquences du programme d'application qui doivent être protégées car faisant partie des portions sécuritaires.This last variant nevertheless makes it possible to trigger the interruptions, but not to be able to intervene on sequences of the application program which must be protected as being part of the secure portions.
Pour le reste, la séquence de déroutement se poursuit de la même façon que pour la figure 2B.For the rest, the diversion sequence continues in the same way as for FIG. 2B.
Enfin, le programme d'application ou une partie du code dormant peut inclure le programme d'écriture qui peut être appelé, par exemple, par une orientation à une adresse fixe initiale, de façon à permettre par l'orientation à ce programme d'écriture, l'écriture de la table de déroutement TAB_DER selon la séquence décrite à la figure 5. Ce programme commence par une étape de réception d'ordre d'inscription d'un ou plusieurs éléments dans la table TAB_DER, les éléments ΔTi, et Adri devant être écrits à la ligne i de l'élément dans la table. Cette étape est poursuivie par une étape de test sur le drapeau d'écriture de la table ECA pour vérifier s'il est actif ou inactif. Dans le cas où ECA est actif, le programme se poursuit par un message d'erreur à l'étape 61 . Dans le cas où ECA est inactif, le programme se poursuit par une étape 53 d'analyse de chaque élément ΔTi par rapport à la valeur correspondante dans la table de sécurité TAB_SEC. Cette étape comporte un test 54 pour déterminer si la valeur ΔTi est dans l'intervalle [ΔTmaxi, ΔTmini]. Dans l'affirmative, le programme se poursuit à l'étape 22043B par une modification du ΔTi représentant la valeur de l'intervalle, de façon à différer l'interruption pour ne pas tomber dans la séquence interdite. Une variante représentée en parallèle consiste à envoyer un message d'erreur 22043A. Ceci est représenté à l'étape 59 par l'opération consistant à remplacerFinally, the application program or a part of the dormant code can include the writing program which can be called, for example, by an orientation to an initial fixed address, so as to allow by orientation to this program write, the write of the diversion table TAB_DER according to the sequence described in figure 5. This program begins with a step of reception of order of inscription of one or more elements in the table TAB_DER, the elements ΔTi, and Adri having to be written in line i of the element in the table. This step is followed by a test step on the write flag of the ECA table to check whether it is active or inactive. If ECA is active, the program continues with an error message in step 61. In the case where ECA is inactive, the program continues with a step 53 of analysis of each element ΔTi with respect to the corresponding value in the security table TAB_SEC. This step includes a test 54 to determine if the value ΔTi is in the interval [ΔTmaxi, ΔTmini]. If so, the program continues at step 22043B by modifying the ΔTi representing the value of the interval, so as to delay the interruption so as not to fall into the prohibited sequence. A variant shown in parallel consists in sending an error message 22043A. This is represented in step 59 by the operation of replacing
(ΔTi) par la valeur (ΔTi+x), x étant l'intervalle (ΔTmaxi-ΔTmini). Dans le cas où le ΔT n'est pas dans l'intervalle ou après modification de la valeur ΔTi, le programme se poursuit par l'étape 55, où on positionne à l'état actif, le drapeau ECA d'écriture de la table. Cette étape effectuée, le programme se poursuit par l'étape 56 de mise à jour de la table de déroutement et de vérification d'écriture. Cette vérification s'effectue par un test représenté à l'étape 57, dans le cas où le test confirme l'écriture correcte, le programme se poursuit par l'examen de savoir s'il y a un autre élément à écrire, dans la négative, le programme se termine à l'étape 62, dans l'affirmative, le programme se reboucle à l'étape 53.(ΔTi) by the value (ΔTi + x), x being the interval (ΔTmaxi-ΔTmini). In the case where the ΔT is not in the interval or after modification of the value ΔTi, the program continues with step 55, where the flag ECA for writing the table is set in the active state . Once this step has been completed, the program continues with step 56 for updating the diversion table and for writing verification. This verification is carried out by a test represented in step 57, in the case where the test confirms the correct writing, the program continues with the examination of whether there is another element to write, in the negative, the program ends in step 62, if so, the program loops back to step 53.
Si le test de vérification est négatif, le programme se poursuit par l'étape 60 de positionnement du drapeau d'écriture à l'état inactif. Dans une variante de l'invention par la table TAB_DER il est même possible de protéger certaines parties de codes sans gêner les possibilités de modification des autres parties.If the verification test is negative, the program continues with step 60 of positioning the writing flag in the inactive state. In a variant of the invention by the table TAB_DER it is even possible to protect certain parts of codes without hampering the possibilities of modification of the other parts.
Une troisième variante consiste à stocker dans la table TAB_SEC en ROM les adresses début et fin associées à chacune des séquences sensibles. Les valeurs d'adresses se déterminent aisément et ne sont pas le résultat d'un calcul pour déterminer une durée comme précédemment.A third variant consists in storing in the table TAB_SEC in ROM the start and end addresses associated with each of the sensitive sequences. The address values are easily determined and are not the result of a calculation to determine a duration as previously.
Par exemplefor example
TAB_SEC : où chaque ligne représente les adresses de début et de fin des séquences sensiblesTAB_SEC: where each line represents the start and end addresses of sensitive sequences
Avantageusement, les fenêtres d'adresses [Adrdeb_i , Adrfin_1] sont mémorisées par adresses croissantes, ceci facilitant la lecture de la table. Par conséquent, les valeurs situées dans les intervalles ]Adrfin_i , Adrdeb_i+1 [ sont des valeurs d'adresses du programme non sensible.Advantageously, the address windows [Adrdeb_i, Adrfin_1] are stored by increasing addresses, this facilitating the reading of the table. Consequently, the values located in the intervals] Adrfin_i, Adrdeb_i + 1 [are address values of the non-sensitive program.
La vérification de l'interruption d'une séquence sensible s'effectue consécutivement à la fin de la durée de temporisation. Lorsque le compteur atteint la valeur nulle, une interruption est déclenchée et la valeur actuelle du PC est mise dans la pile, puis le programme se déroute à l'adresse définie dans la partie de la mémoire ROM plus communément appelée : "vecteur d'interruption". Le concepteur du programme a pris soin d'initialiser la valeur du vecteur correspondant à l'interruption générée par la fin du comptage avec l'adresse du début de la séquence de code de l'interruption. Ladite routine est en ROM, et donc non modifiable, ceci pour des raisons de sécurité, elle sera donc toujours exécutée.Verification of the interruption of a sensitive sequence is carried out consecutively at the end of the delay time. When the counter reaches the zero value, an interrupt is triggered and the current value of the PC is put in the stack, then the program diverted to the address defined in the part of the ROM memory more commonly called: "interrupt vector ". The designer of the program has taken care to initialize the value of the vector corresponding to the interrupt generated by the end of the counting with the address of the start of the code sequence of the interrupt. Said routine is in ROM, and therefore cannot be modified, for security reasons, it will therefore always be executed.
Au début de ladite séquence de code de l'interruption, on vérifie que la valeur du PC : Val_PC mémorisée dans la pile (c'est-à-dire l'adresse de l'instruction que le microprocesseur devait exécuter s'il n'y avait pas eu d'interruption) n'est pas une valeur d'adresse de séquence sensible. Si la table TAB_SEC n'existe pas ou est vide, le test n'est pas effectué et le programme exécute directement la nouvelle séquence de code. Sinon, le programme de la routine extrait la valeur Val_PC de la pile et recherche dans la table TAB_SEC entre quelles valeurs d'adresse elle se situe.At the start of said interrupt code sequence, it is checked that the value of the PC: Val_PC stored in the stack (that is to say the address of the instruction that the microprocessor should execute if it does not was not interrupted) is not a sensitive sequence address value. If the table TAB_SEC does not exist or is empty, the test is not carried out and the program directly executes the new code sequence. Otherwise, the routine program extracts the value Val_PC from the stack and searches the table TAB_SEC between which address values it is located.
Si les valeurs sont du type [Adrdeb_i , AdrfinJ], le programme a été interrompu pendant une séquence sensible, la carte peut renvoyer un message indiquant que sa sécurité est atteinte et peut se bloquer. Si les valeurs sont du type ]Adrfin_i , Adrdeb_i+1 [ le programme a été interrompu pendant une séquence non sensible, le programme exécute alors la nouvelle séquence de code dont l'adresse de début a été mémorisée lors du traitement du point d'orientation.If the values are of the type [Adrdeb_i, AdrfinJ], the program has been interrupted during a sensitive sequence, the card may return a message indicating that its security has been reached and may block. If the values are of the type] Adrfin_i, Adrdeb_i + 1 [the program was interrupted during a non-sensitive sequence, the program then executes the new code sequence whose start address was memorized during the processing of the orientation point .
D'autres modifications font également partie de l'esprit de l'invention. Other modifications are also part of the spirit of the invention.
Annexe 1Annex 1
Voici ci-dessous une partie de code exécutable d'un programme principal, est écrit en assembleur MOTOROLA 6805 :Here below is a part of executable code of a main program, is written in MOTOROLA 6805 assembler:
adr 0 LDX #01 Chargement du pointeur avec numéro du point d'orientationadr 0 LDX # 01 Load pointer with orientation point number
JSR INS ORT Saut au point d'orientation NOPJSR INS ORT Jump to NOP orientation point
adr 1 LDX #080H Chargement de la valeur hexadécimale 80 dans le pointeur X.adr 1 LDX # 080H Loading of the hexadecimal value 80 in the pointer X.
LDA ,χ Chargement de l'accumulateur A avec le contenu de l'adresse 80.LDA, χ Charging accumulator A with the contents of address 80.
BEQ V ZERO Branchement si égal zéro à V_ZERO, sinon instruction suivante adr_2 LDB #01 Od Chargement de l'accumulateur B avec la valeur décimale 10 adr_3 MUL multiplication de A par BBEQ V ZERO Connection if equal zero to V_ZERO, otherwise following instruction adr_2 LDB # 01 Od Charging of accumulator B with decimal value 10 adr_3 MUL multiplication of A by B
STA Reg_H Mémorisation du contenu de H dans l'accumulateur A.STA Reg_H Storage of the content of H in accumulator A.
STB Reg_L Mémorisation du contenu de L dans l'accumulateur B.STB Reg_L Storage of the content of L in accumulator B.
JSR Ecrit_Mot V ZERO JMP SuiteJSR Ecrit_Mot V ZERO JMP Suite
Annexe 2Annex 2
Adri LDB #020d JMP adr 3 Adri LDB # 020d JMP adr 3

Claims

REVENDICATIONS
1. Dispositif de modification de séquences de code dans un support comprenant une unité centrale (1 ) capable d'exécuter ces séquences de code, une première mémoire (2) contenant un programme comprenant au moins une séquence de code exécutable par l'unité centrale (1 ), et une seconde mémoire programmable (3), caractérisé en ce qu'une table de déroutement TAB_DER contenue dans la seconde mémoire programmable contient au moins un champ contenant une donnée de référence d'une nouvelle séquence de code stockée dans une desdites mémoires, des moyens de déroutement permettant un déroutement différé depuis une séquence de code dudit programme en cours d'exécution vers ladite nouvelle séquence de code, et des moyens prévus dans la nouvelle séquence de code pour permettre, une fois la nouvelle séquence de code exécutée, un retour en un point de ladite séquence de code du programme.1. Device for modifying code sequences in a medium comprising a central unit (1) capable of executing these code sequences, a first memory (2) containing a program comprising at least one code sequence executable by the central unit (1), and a second programmable memory (3), characterized in that a diversion table TAB_DER contained in the second programmable memory contains at least one field containing reference data of a new code sequence stored in one of said memories, diversion means allowing deferred diversion from a code sequence of said running program to said new code sequence, and means provided in the new code sequence for allowing, once the new code sequence has been executed , a return to a point of said program code sequence.
2. Dispositif de modification de séquences de code selon la revendication 1 caractérisé en ce que les moyens de déroutement consistent en des instructions d'orientation (lORi) activables et implantées au préalable dans la mémoire contenant le code du programme, chaque instruction d'orientation étant associée à une référence i de la table de déroutement TAB_DER inscrite en mémoire programmable (3).2. Device for modifying code sequences according to claim 1 characterized in that the diversion means consist of orientation instructions (lORi) which can be activated and installed beforehand in the memory containing the program code, each orientation instruction being associated with a reference i of the diversion table TAB_DER written in programmable memory (3).
3. Dispositif de modification de séquences de code selon la revendication 2, caractérisé en ce que chaque instruction d'orientation (lORi) activée déclenche l'exécution d'une séquence nouvelle de code comportant :3. Device for modifying code sequences according to claim 2, characterized in that each activated orientation instruction (lORi) triggers the execution of a new code sequence comprising:
- des moyens de lire dans la table TAB_DER de la mémoire programmable (3) un délai de temporisation ΔTi correspondant à la référence de l'instruction d'orientation, ce délai de temporisation permettant de différer le déclenchement d'une interruption qui effectue un branchement à une séquence nouvelle de code dont l'adresse (Adri) est indiquée dans la table, en association avec le délai de temporisation,means of reading from the table TAB_DER of the programmable memory (3) a time delay ΔTi corresponding to the reference of the orientation instruction, this time delay allowing defer the triggering of an interrupt which connects to a new code sequence whose address (Adri) is indicated in the table, in association with the delay time,
- des moyens de mémoriser l'adresse (Adri) dans une mémoire du dispositif etmeans of memorizing the address (Adri) in a memory of the device and
- des moyens de lancer un compteur (6) de temps du dispositif pour décompter le temps nécessaire au délai de temporisation du branchement.- Means of launching a time counter (6) of the device to count down the time necessary for the connection delay time.
4. Dispositif de modification de séquences de code selon la revendication 3, caractérisé en ce qu'il comporte une seconde table TAB_SEC mémorisée dans la mémoire du dispositif et associant à chaque point (i) de déroutement un intervalle de temps [ΔTmini ; ΔTmaxi] associé au délai de temporisation ΔTi préalable à l'exécution d'une nouvelle séquence de code, et des moyens de vérification que le délai de temporisation est autorisé par l'intervalle de temps associé fourni par cette table.4. Device for modifying code sequences according to claim 3, characterized in that it comprises a second table TAB_SEC stored in the memory of the device and associating with each point (i) diversion a time interval [ΔTmini; ΔTmaxi] associated with the delay time ΔTi prior to the execution of a new code sequence, and means of verification that the delay time is authorized by the associated time interval provided by this table.
5. Dispositif de modification de séquences de code selon la revendication 4, caractérisé en ce qu'il comporte des moyens permettant le décalage du délai ΔTi de temporisation de la valeur de l'intervalle de temps [ΔTmini ; ΔTmaxi].5. Device for modifying code sequences according to claim 4, characterized in that it includes means allowing the delay ΔTi delay delay to be offset by the value of the time interval [ΔTmini; ΔTmaxi].
6. Dispositif de modification de séquences de code selon la revendication 4, caractérisé en ce qu'il comporte des moyens de déclencher un message d'erreur lorsque le délai de temporisation ΔTi est dans l'intervalle de temps.6. Device for modifying code sequences according to claim 4, characterized in that it includes means for triggering an error message when the time delay ΔTi is in the time interval.
7. Dispositif de modification de séquences de code selon la revendication 3, caractérisé en ce qu'il comporte consécutivement à la fin du délai de temporisation (ΔTi), lorsque le compteur (6) atteint la valeur nulle, des moyens de déclencher une interruption, des moyens de mémorisation de la valeur actuelle d'un registre compteur programme PC dans une pile, puis des moyens de dérouter le programme à l'adresse définie dans la partie de la mémoire ROM contenant des vecteurs d'interruption, qui fournissent l'adresse du début de la séquence de code de l'interruption, des moyens de vérifier que la valeur du registre compteur programme PC Val_PC mémorisée dans la pile n'est pas une valeur d'adresse de séquence sensible contenue dans une table TAB_SEC, et des moyens de modifier le déroulement des opérations.7. Device for modifying code sequences according to claim 3, characterized in that it consecutively at the end of the delay time (ΔTi), when the counter (6) reaches the zero value, means for triggering an interruption means for memorizing the current value of a PC program counter register in a stack, then means of diverting the program to the address defined in the part of the ROM memory containing interrupt vectors, which supply the address of the start of the interrupt code sequence, means of verifying that the value of the PC program counter register Val_PC stored in the stack is not a sensitive sequence address value contained in a table TAB_SEC, and means for modifying the sequence of operations.
8. Dispositif de modification de séquences de code selon la revendication 7, caractérisé en ce que, soit les moyens de vérification testent si la valeur du registre compteur programme est contenue par TAB_SEC dans l'intervalle [Adrdeb_i , Adrfin_1 ], correspondant à une interruption du programme pendant une séquence sensible et les moyens de modifier le déroulement des opérations de la carte renvoient un message indiquant que sa sécurité est atteinte et se bloque, soit les moyens de vérification testent si la valeur du registre compteur programme Val_PC est contenue dans l'intervalle ]Adrfin_i , Adrdeb_i+1 [ correspondant à une interruption du programme pendant une séquence non sensible et les moyens de modifier le déroulement des opérations autorisent le programme à exécuter alors la nouvelle séquence de code dont l'adresse de début a été mémorisée lors du traitement de l'instruction d'orientation (lORi).8. Device for modifying code sequences according to claim 7, characterized in that either the verification means test whether the value of the program counter register is contained by TAB_SEC in the interval [Adrdeb_i, Adrfin_1], corresponding to an interruption of the program during a sensitive sequence and the means of modifying the course of the operations of the card return a message indicating that its security is reached and is blocked, either the means of verification test if the value of the register counter program Val_PC is contained in the interval] Adrfin_i, Adrdeb_i + 1 [corresponding to an interruption of the program during a non-sensitive sequence and the means of modifying the sequence of operations authorize the program then to execute the new code sequence whose start address was memorized during the processing of the orientation instruction (lORi).
9. Dispositif de modification de séquences de code selon la revendication 1 , caractérisé en ce qu'il comporte une source de fréquence pour le compteur (6), différente d'une source de fréquence permettant à l'unité centrale (1 ) d'exécuter le programme, la valeur du délai de temporisation (ΔTi) programmée dans la table de déroutement TAB_DER étant calculée pour permettre d'interrompre le programme à une adresse déterminée, la table TAB_DER comporte pour chaque valeur du délai de temporisation, un élément supplémentaire contenant cette adresse déterminée et des moyens de comparer l'adresse de l'instruction interrompue par l'interruption, à celle indiquée dans la table, et de provoquer une alarme.9. Device for modifying code sequences according to claim 1, characterized in that it comprises a frequency source for the counter (6), different from a frequency source allowing the central unit (1) to execute the program, the value of the delay time (ΔTi) programmed in the diversion table TAB_DER being calculated to allow the program to be interrupted at a determined address, the table TAB_DER comprises for each value of the delay time, an additional element containing this determined address and means to compare the address of the instruction interrupted by the interrupt, to that indicated in the table, and cause an alarm.
10. Dispositif de modification de séquences de code selon la revendication précédente, caractérisé en ce qu'il comporte des moyens de déclencher une alarme pour bloquer le support et indiquer une tentative de fraude par une écriture dans la mémoire.10. Device for modifying code sequences according to the preceding claim, characterized in that it includes means for triggering an alarm to block the support and indicate an attempt at fraud by writing to the memory.
11. Dispositif de modification de séquences de code selon la revendication 1 ou 3, caractérisé en ce que chaque séquence nouvelle de code se termine par une instruction d'orientation pour recharger le compteur (6) avec une nouvelle valeur de délai de temporisation (ΔTi).11. Device for modifying code sequences according to claim 1 or 3, characterized in that each new code sequence ends with an orientation instruction to reload the counter (6) with a new time delay value (ΔTi ).
12. Procédé de modification de séquences de code figées inscrites dans un support comportant une unité centrale et une mémoire (2), caractérisé en ce qu'il consiste à prévoir dans au moins une séquence de code figée, au moins une instruction d'orientation (lORi), permettant de dérouter, par une interruption différée d'un délai de temporisation, l'exécution d'un programme contenu dans la mémoire vers une adresse déterminée, par une table de déroutement TAB_DER, en fonction d'une référence i associée à l'instruction d'orientation et dans un délai de temporisation, déterminé par le contenu d'une ligne de table correspondant à la référence i de l'instruction d'orientation, une séquence nouvelle de code exécutable lors de l'interruption générée à la fin du délai de temporisation étant implantée à l'adresse contenue dans la table (TAB_DER).12. Method for modifying frozen code sequences written in a support comprising a central unit and a memory (2), characterized in that it consists in providing in at least one fixed code sequence, at least one orientation instruction (lORi), allowing to divert, by a deferred interruption of a time delay, the execution of a program contained in the memory to a determined address, by a diversion table TAB_DER, according to an associated reference i to the orientation instruction and within a timeout period, determined by the content of a table row corresponding to the reference i of the orientation instruction, a new sequence of code executable during the interruption generated at the end of the delay time being located at the address contained in the table (TAB_DER).
13. Procédé selon la revendication 12, caractérisé en ce qu'une étape déclenchant l'interruption est précédée d'une étape de vérification, consistant à vérifier que le délai de temporisation n'est pas inclus dans un intervalle défini par une seconde table TAB_SEC dite sécuritaire inscrite dans la mémoire non volatile du support. 13. Method according to claim 12, characterized in that a step triggering the interruption is preceded by a verification step, consisting in verifying that the delay time is not included in an interval defined by a second table TAB_SEC said safe registered in the non-volatile memory of the support.
EP98930843A 1997-06-13 1998-06-12 Method for modifying code sequences and related device Withdrawn EP0919026A1 (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
FR9707321 1997-06-13
FR9707321A FR2764716B1 (en) 1997-06-13 1997-06-13 METHOD FOR MODIFYING CODE SEQUENCES AND ASSOCIATED DEVICE
PCT/FR1998/001228 WO1998057255A1 (en) 1997-06-13 1998-06-12 Method for modifying code sequences and related device

Publications (1)

Publication Number Publication Date
EP0919026A1 true EP0919026A1 (en) 1999-06-02

Family

ID=9507918

Family Applications (1)

Application Number Title Priority Date Filing Date
EP98930843A Withdrawn EP0919026A1 (en) 1997-06-13 1998-06-12 Method for modifying code sequences and related device

Country Status (5)

Country Link
US (1) US6536034B1 (en)
EP (1) EP0919026A1 (en)
JP (1) JP3563412B2 (en)
FR (1) FR2764716B1 (en)
WO (1) WO1998057255A1 (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2995030B2 (en) * 1998-03-31 1999-12-27 三洋電機株式会社 Computer system and program and data correction method in computer system
US6260157B1 (en) * 1999-02-16 2001-07-10 Kurt Schurecht Patching of a read only memory
GB2349485B (en) * 1999-04-23 2003-12-10 Ibm Application management
FR2795838B1 (en) * 1999-06-30 2001-08-31 Bull Cp8 METHOD FOR SECURING THE PROCESSING OF SENSITIVE INFORMATION IN A MONOLITHIC SECURITY MODULE, AND RELATED SECURITY MODULE
US7152224B1 (en) * 2000-11-21 2006-12-19 Microsoft Corporation Versioned project associations
FR2818766A1 (en) * 2000-12-21 2002-06-28 Bull Cp8 METHOD FOR SECURING THE EXECUTION OF AN IMPLANTED PROGRAM IN AN ELECTRONIC MODULE WITH MICROPROCESSOR, AS WELL AS THE ELECTRONIC MODULE AND THE MICROCIRCUIT CARD THEREOF
JP2005332221A (en) * 2004-05-20 2005-12-02 Renesas Technology Corp Storage device
JP4038216B2 (en) * 2005-05-10 2008-01-23 ファナック株式会社 Sequence program editing device
US9348730B2 (en) * 2007-01-31 2016-05-24 Standard Microsystems Corporation Firmware ROM patch method
FR2928754B1 (en) * 2008-03-13 2012-05-18 Sagem Securite INTEGRATED CIRCUIT BOARD HAVING AN ALTERNATIVE OPERATING PROGRAM AND CORRESPONDING MODIFICATION METHOD
US8200888B2 (en) * 2008-06-30 2012-06-12 Intel Corporation Seek time emulation for solid state drives
US9348597B2 (en) * 2008-06-30 2016-05-24 Infineon Technologies Ag Device and method for bypassing a first program code portion with a replacement program code portion
US8930894B2 (en) * 2008-10-08 2015-01-06 Oracle America, Inc. Method and system for executing an executable file
FR2999845A1 (en) * 2012-12-14 2014-06-20 Thomson Licensing METHOD FOR ACTIVATING A MAINTENANCE MODE IN AN ELECTRONIC DEVICE AND ASSOCIATED DEVICE
DE102015211458A1 (en) * 2015-06-22 2016-12-22 Robert Bosch Gmbh A method and apparatus for securing a program counter structure of a processor system and for monitoring the handling of an interrupt request
US9892024B2 (en) 2015-11-02 2018-02-13 Sony Interactive Entertainment America Llc Backward compatibility testing of software in a mode that disrupts timing
CN116643140A (en) * 2022-02-15 2023-08-25 华为技术有限公司 Integrated circuit and testing method thereof

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4542453A (en) * 1982-02-19 1985-09-17 Texas Instruments Incorporated Program patching in microcomputer
JPS5969749A (en) * 1982-10-14 1984-04-20 Sharp Corp Optical device of electrophotographic copying machine
US4831517A (en) * 1986-10-10 1989-05-16 International Business Machines Corporation Branch and return on address instruction and methods and apparatus for implementing same in a digital data processing system
US5623665A (en) * 1992-01-13 1997-04-22 Sony Corporation Electronic apparatus for patching a read-only memory
US5748981A (en) * 1992-10-20 1998-05-05 National Semiconductor Corporation Microcontroller with in-circuit user programmable microcode
US5485629A (en) * 1993-01-22 1996-01-16 Intel Corporation Method and apparatus for executing control flow instructions in a control flow pipeline in parallel with arithmetic instructions being executed in arithmetic pipelines

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See references of WO9857255A1 *

Also Published As

Publication number Publication date
US6536034B1 (en) 2003-03-18
FR2764716A1 (en) 1998-12-18
JP2000500897A (en) 2000-01-25
FR2764716B1 (en) 2001-08-17
JP3563412B2 (en) 2004-09-08
WO1998057255A1 (en) 1998-12-17

Similar Documents

Publication Publication Date Title
EP0919026A1 (en) Method for modifying code sequences and related device
EP0626664B1 (en) Communication system using IC cards
EP1161725B1 (en) Method for monitoring a programme flow
FR2977694A1 (en) MICROPROCESSOR PROTECTS AGAINST A BATTERY OVERFLOW
EP3018609B1 (en) Method for loading a file into ram in an electronic apparatus and associated electronic apparatus
FR2471000A1 (en) METHOD AND DEVICE FOR CONTROLLING THE NUMBER OF TENTATIVES FOR ACCESSING AN ELECTRONIC MEMORY, IN PARTICULAR AN INTEGRATED CIRCUIT OF AN OBJECT SUCH AS A CREDIT CARD OR A PURCHASE CARD
FR2627609A1 (en) PORTABLE ELECTRONIC DEVICE
EP1748374A1 (en) Procedure and device protecting a memory against attacks by error injection
EP3182292A1 (en) Method for predicting data to be pre-loaded in a cache memory
EP1108249B1 (en) Method for making secure a sensitive information processing in a monolithic security module, and associated security module
EP2158557B1 (en) Method and device for the detection of error jumps during the execution of a program
EP0718794A1 (en) Method and device for increasing the security of an integrated circuit
EP1939745B1 (en) Method and device for securing the reading of a memory
EP1258004B1 (en) Secure real time writing for non volatile storage
WO1997041510A1 (en) Method and device enabling a fixed programme to be developed
EP3042334B1 (en) Method of setting up safety means depending on a trust indicia varying before and after command execution in an electronic device with memory, and device for implementing said method
EP1058917B1 (en) Loading block computer programmes
EP4086801B1 (en) Function execution method characterized by temporal desynchronisation
FR2632093A1 (en) MODULAR MEMORY
WO2007006887A1 (en) Protection against attacks by generating errors on jump instructions
CA2264896A1 (en) Security module comprising means generating links between main files and auxiliary files
FR2740236A1 (en) DEVICE FOR MONITORING THE USE OF SOFTWARE, SYSTEM COMPRISING SEVERAL OF THESE DEVICES AND METHOD FOR CONTROLLING THE SAME
EP1064776B1 (en) Method for securely managing a units counter and security module implementing said method
FR2795836A1 (en) Method of evaluation of timing of data processing device by executing program contained in memory while adding time of execution to form accumulated value of time during such operation
EP1760614B1 (en) Synchronised updating of data files

Legal Events

Date Code Title Description
PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

AK Designated contracting states

Kind code of ref document: A1

Designated state(s): BE CH DE DK ES FI FR GB IE IT LI NL PT SE

17P Request for examination filed

Effective date: 19990617

RAP1 Party data changed (applicant data changed or rights of an application transferred)

Owner name: CP8 TECHNOLOGIES

17Q First examination report despatched

Effective date: 20071005

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE APPLICATION IS DEEMED TO BE WITHDRAWN

18D Application deemed to be withdrawn

Effective date: 20150106