DE102016106819A1 - Method for updating a firmware component and device of measurement and control technology - Google Patents

Method for updating a firmware component and device of measurement and control technology Download PDF

Info

Publication number
DE102016106819A1
DE102016106819A1 DE102016106819.5A DE102016106819A DE102016106819A1 DE 102016106819 A1 DE102016106819 A1 DE 102016106819A1 DE 102016106819 A DE102016106819 A DE 102016106819A DE 102016106819 A1 DE102016106819 A1 DE 102016106819A1
Authority
DE
Germany
Prior art keywords
firmware
crypto
data
algorithm
authentication
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.)
Pending
Application number
DE102016106819.5A
Other languages
German (de)
Inventor
Björn Haase
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.)
Endress & Hauser Conducta & Co Kg GmbH
Endress and Hauser Conducta GmbH and Co KG
Original Assignee
Endress & Hauser Conducta & Co Kg GmbH
Endress and Hauser Conducta GmbH and Co KG
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 Endress & Hauser Conducta & Co Kg GmbH, Endress and Hauser Conducta GmbH and Co KG filed Critical Endress & Hauser Conducta & Co Kg GmbH
Priority to CN201710227906.0A priority Critical patent/CN107368744B/en
Priority to US15/483,208 priority patent/US10481900B2/en
Publication of DE102016106819A1 publication Critical patent/DE102016106819A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/572Secure firmware programming, e.g. of basic input output system [BIOS]
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61MDEVICES FOR INTRODUCING MEDIA INTO, OR ONTO, THE BODY; DEVICES FOR TRANSDUCING BODY MEDIA OR FOR TAKING MEDIA FROM THE BODY; DEVICES FOR PRODUCING OR ENDING SLEEP OR STUPOR
    • A61M39/00Tubes, tube connectors, tube couplings, valves, access sites or the like, specially adapted for medical use
    • A61M39/02Access sites
    • A61M39/06Haemostasis valves, i.e. gaskets sealing around a needle, catheter or the like, closing on removal thereof
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61MDEVICES FOR INTRODUCING MEDIA INTO, OR ONTO, THE BODY; DEVICES FOR TRANSDUCING BODY MEDIA OR FOR TAKING MEDIA FROM THE BODY; DEVICES FOR PRODUCING OR ENDING SLEEP OR STUPOR
    • A61M39/00Tubes, tube connectors, tube couplings, valves, access sites or the like, specially adapted for medical use
    • A61M39/02Access sites
    • A61M39/06Haemostasis valves, i.e. gaskets sealing around a needle, catheter or the like, closing on removal thereof
    • A61M39/0606Haemostasis valves, i.e. gaskets sealing around a needle, catheter or the like, closing on removal thereof without means for adjusting the seal opening or pressure
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/575Secure boot
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3242Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving keyed hash functions, e.g. message authentication codes [MACs], CBC-MAC or HMAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61MDEVICES FOR INTRODUCING MEDIA INTO, OR ONTO, THE BODY; DEVICES FOR TRANSDUCING BODY MEDIA OR FOR TAKING MEDIA FROM THE BODY; DEVICES FOR PRODUCING OR ENDING SLEEP OR STUPOR
    • A61M39/00Tubes, tube connectors, tube couplings, valves, access sites or the like, specially adapted for medical use
    • A61M39/02Access sites
    • A61M39/06Haemostasis valves, i.e. gaskets sealing around a needle, catheter or the like, closing on removal thereof
    • A61M2039/062Haemostasis valves, i.e. gaskets sealing around a needle, catheter or the like, closing on removal thereof used with a catheter
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61MDEVICES FOR INTRODUCING MEDIA INTO, OR ONTO, THE BODY; DEVICES FOR TRANSDUCING BODY MEDIA OR FOR TAKING MEDIA FROM THE BODY; DEVICES FOR PRODUCING OR ENDING SLEEP OR STUPOR
    • A61M39/00Tubes, tube connectors, tube couplings, valves, access sites or the like, specially adapted for medical use
    • A61M39/02Access sites
    • A61M39/06Haemostasis valves, i.e. gaskets sealing around a needle, catheter or the like, closing on removal thereof
    • A61M2039/0633Haemostasis valves, i.e. gaskets sealing around a needle, catheter or the like, closing on removal thereof the seal being a passive seal made of a resilient material with or without an opening
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/80Wireless
    • H04L2209/805Lightweight hardware, e.g. radio-frequency identification [RFID] or sensor

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Animal Behavior & Ethology (AREA)
  • General Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Pulmonology (AREA)
  • Anesthesiology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Hematology (AREA)
  • Biomedical Technology (AREA)
  • Power Engineering (AREA)
  • Stored Programmes (AREA)
  • Storage Device Security (AREA)

Abstract

Die Erfindung betrifft ein Verfahren zum Aktualisieren einer die Funktionalität eines Geräts der Mess- und Regeltechnik bereitstellenden ersten Firmware-Komponente, welche in einen Mikrocontroller des Geräts eingebettet ist, umfassend: – Segmentweises Empfangen eines ersten Firmware-Images über ein mit einem externen Gerät verbundenes Dateninterface des Mikrocontrollers, wobei das erste Firmware-Image einen Datenbereich und ein Signaturfeld umfasst, und wobei der Datenbereich zur Aktualisierung der ersten Firmware-Komponente dienende, einen Firmware-Programmcode umfassende Daten enthält und das Signaturfeld eine nach einem ersten Kryptoverfahren erzeugte erste Authentifizierungsinformation enthält; – Durchführen einer Authentifizierung des ersten Firmware-Images anhand der ersten Authentifizierungsinformation mittels eines von der ersten Firmware-Komponente umfassten Authentifizierungs-Algorithmus nach dem ersten Kryptoverfahren; – Erzeugen einer zweiten Authentifizierungsinformation für die im Datenbereich des ersten Firmware-Images enthaltenen Daten mittels eines von der ersten Firmware-Komponente umfassten Algorithmus zur Erzeugung der zweiten Authentifizierungsinformation nach einem von dem ersten Kryptoverfahren verschiedenen, zweiten Kryptoverfahren; – nach erfolgreicher Authentifizierung des ersten Firmware-Images Speichern der zweiten Authentifizierungsinformation in einem persistenten Speicher des Geräts; – Löschen der ersten Firmware-Komponente, wobei das Löschen durch eine in den Mikrocontroller eingebettete zweite Firmware-Komponente gesteuert wird; – erneute Übertragung der zur Aktualisierung der ersten Firmware-Komponente dienenden Daten als Bestandteil eines zweiten Firmware-Images unter Beteiligung der zweiten Firmware-Komponente über das Dateninterface an den Mikrocontroller und Speichern der Daten im persistenten Speicher des Mikrocontrollers; – Durchführen einer Authentifizierung des bei der erneuten Übertragung empfangenen zweiten Firmware-Images anhand der in dem Mikrocontroller gespeicherten zweiten Authentifizierungsinformation mittels eines von der zweiten Firmware-Komponente umfassten Authentifizierungs-Algorithmus nach dem zweiten Kryptoverfahren, und – für den Fall einer erfolgreichen Authentifizierung des zweiten Firmware-Images Aktivschalten und Ausführen des mit dem zweiten Firmware-Image übertragenen und gespeicherten Firmware-Programmcodes als neue erste Firmware-Komponente.The invention relates to a method for updating a first firmware component which provides the functionality of a device of the measurement and control technology and which is embedded in a microcontroller of the device, comprising: segment-wise receiving of a first firmware image via a data interface connected to an external device the microcontroller, wherein the first firmware image comprises a data area and a signature field, and wherein the data area for updating the first firmware component includes data comprising a firmware program code and the signature field contains a first authentication information generated after a first crypto process; Performing authentication of the first firmware image based on the first authentication information using an authentication algorithm included in the first firmware component after the first crypto-method; Generating second authentication information for the data contained in the data area of the first firmware image by means of an algorithm comprised by the first firmware component for generating the second authentication information according to a second crypto method different from the first crypto method; After successful authentication of the first firmware image, storing the second authentication information in a persistent memory of the device; Deleting the first firmware component, wherein the deletion is controlled by a second firmware component embedded in the microcontroller; Retransmission of the data used to update the first firmware component as part of a second firmware image involving the second firmware component via the data interface to the microcontroller and storing the data in the persistent memory of the microcontroller; Performing an authentication of the second firmware image received at the retransmission based on the second authentication information stored in the microcontroller by means of an authentication algorithm included in the second firmware component according to the second crypto method, and in the case of a successful authentication of the second firmware -Images Activating and executing the firmware program code transferred and stored with the second firmware image as the new first firmware component.

Description

Die Erfindung betrifft ein Verfahren zum Aktualisieren einer die Funktionalität eines Geräts der Mess- und Regeltechnik bereitstellenden Firmware-Komponente und ein Gerät der Mess- und Regeltechnik.The invention relates to a method for updating the functionality of a device of measurement and control technology providing firmware component and a device of measurement and control technology.

Mess- und Regelaufgaben im Industriebereich sind häufig sicherheitskritisch. Die Kundenanwendungen erfordern die Sicherstellung der Korrektheit und Verfügbarkeit von Mess- und Regelgrößen der jeweiligen Automatisierung. Integrität und Verfügbarkeit der Daten ist in den meisten Fällen von höherer Relevanz als die ebenfalls wichtige Vertraulichkeit. Die besondere Sicherheitsrelevanz von Geräten der Mess- und Regeltechnik, wie Messgeräten, Steuerungen, Sensoren, Aktoren, Überwachungsschaltungen, Warnanzeigen, Feldbus-Netzwerktechnik etc. erwächst dadurch, dass die Folge von Fehlfunktionen oder Manipulationen an diesen Geräten Gefahren, wie Explosionen, Austritt von Gefahrstoffen/Gasen, etc., sein können.Measurement and control tasks in the industrial sector are often safety-critical. Customer applications require the correctness and availability of measured and controlled variables of the respective automation. Integrity and availability of the data is in most cases of greater relevance than the also important confidentiality. The particular safety relevance of measuring and control devices, such as measuring devices, controls, sensors, actuators, monitoring circuits, warning displays, fieldbus network technology, etc. arises because the result of malfunction or manipulation of these devices are dangers such as explosions, leakage of hazardous substances / Gases, etc., can be.

Automatisierungslösungen bestehen aus einer Vielzahl von unabhängigen Teilkomponenten, wie Steuerungen, Sensoren, Netzwerk-Infrastrukturkomponenten wie Router, etc.. Diese Teilkomponenten können jeweils für sich als einzelnes Gerät der Mess- und Regeltechnik ausgestaltet sein oder auch mindestens teilweise in einem Gerät zusammengefasst sein. Jede dieser Teilkomponenten enthält heute in der Regel eigene Softwarekomponenten, sogenannte Firmwares. Noch dazu kann wiederum jedes einzelne Gerät, z.B. ein Feldgerät zur pH-Wertmessung, aus mehreren Teilmodulen bestehen, die jeweils eine eigene Firmware enthalten, z.B. ein Untersystem mit je einem Mikrocontroller für ein Feldbusinterface, ein Untersystem für die Messwert-Signalverarbeitung sowie ein Untersystem für die Analog-Digitalwandlung. Die Firmware ist jeweils in die Mikrocontroller eingebettet. Neben der Integrität der Datenübertragung auf den Kommunikationsschnittstellen (Feldbus, Ethernet, Wireless-Hart etc.) der Geräte oder Teilkomponenten ist auch die Integrität der Messwertverarbeitung in den Teilkomponenten (Transmitter, Sensor) für die Korrektheit der Messwerte entscheidend.Automation solutions consist of a large number of independent subcomponents, such as controllers, sensors, network infrastructure components such as routers, etc. These subcomponents can each be configured individually as a single device of the measurement and control technology or at least partially combined in one device. Each of these subcomponents today usually contains its own software components, so-called firmwares. In addition, every single device, e.g. a field device for pH measurement, consist of several sub-modules, each containing its own firmware, e.g. a subsystem with a microcontroller for a fieldbus interface, a subsystem for the measured value signal processing and a subsystem for the analog-to-digital conversion. The firmware is embedded in the microcontroller. In addition to the integrity of the data transmission on the communication interfaces (fieldbus, Ethernet, wireless hard, etc.) of the devices or subcomponents, the integrity of the measured value processing in the subcomponents (transmitter, sensor) is crucial for the correctness of the measured values.

Ein mögliches Angriffs-Szenario besteht darin, dass ein Angreifer dem Betreiber einer Automatisierungsanlage manipulierte Firmware-Komponenten unterschiebt. So könnten beispielsweise innerhalb eines Temperatursensors die vom Sensor gemessenen Temperaturmesswerte bewusst innerhalb der Firmware manipuliert werden, so dass dem mit dem Sensor verbundenen Leitsystem eine für den Betrieb der Anlage unkritische Temperatur gemeldet wird, während in Wahrheit der überwachte Prozess stark erhöhte Temperaturen aufweist, die z.B. zu einer Explosion eines Tanks führen können.One possible attack scenario is that an attacker defers manipulated firmware components to the operator of an automation system. For example, within a temperature sensor, the temperature readings measured by the sensor could be deliberately manipulated within the firmware such that a non-critical temperature for the operation of the system is reported to the control system connected to the sensor, while in fact the monitored process has greatly elevated temperatures, e.g. can lead to an explosion of a tank.

Für einen erfolgreichen Angriff reicht es in der Regel aus, innerhalb eines angegriffenen Geräts oder eines eine Vielzahl von Geräten umfassenden angegriffenen Systems die Firmware einer beliebigen Teilkomponente zu manipulieren.For a successful attack, it is usually sufficient to manipulate the firmware of any subcomponent within a compromised device or a system attacked by a variety of devices.

Ein konkretes Beispiel anhand einer pH-Messstelle: Eine pH-Messstelle umfasst in der Regel einen pH- und einen Temperaturmesswandler, die häufig in einem einzigen Gerät zusammengefasst sind. Das Gerät umfasst weiter eine mit den Messwandlern verbundene Geräteelektronik. Diese kann beispielsweise einen oder mehrere Mikrocontroller zur Analog-Digitalwandlung der Ausgangssignale der Messwandler, einen weiteren Mikrocontroller für die Messsignalverarbeitung, ein Feldbusinterface zur Übertragung der Messsignale über einen Feldbus und ein System, welches sich um die Bedienung des Feldbusinterfaces kümmert, umfassen. Möchte ein Angreifer beispielsweise die übermittelten Temperaturmesswerte einer solchen pH-Messstelle manipulieren, so kann er das Ziel dadurch erreichen, dass wahlweise die Firmware innerhalb des Mikrokontrollers zur Analog-Digitalwandlung des Ausgangssignals des Temperaturmesswandlers oder die Firmware einer der anderen Teilkomponenten des Geräts manipuliert wird.A concrete example using a pH measuring point: A pH measuring point usually comprises a pH and a temperature transducer, which are often combined in a single device. The device further includes a device electronics connected to the transducers. This can include, for example, one or more microcontrollers for analog-to-digital conversion of the output signals of the transducers, a further microcontroller for the measurement signal processing, a fieldbus interface for transmitting the measurement signals via a fieldbus and a system which handles the operation of the fieldbus interfaces. For example, if an attacker wants to manipulate the transmitted temperature readings of such a pH meter, he may achieve the goal by selectively manipulating the firmware within the microcontroller for analog-to-digital conversion of the output of the temperature transducer or the firmware of one of the other subcomponents of the device.

Das sichere Abwehren eines vermittels manipulierter Firmware-Komponenten gestarteten Angriffs setzt somit voraus, dass die Firmware aller beteiligten Subsysteme und Teilkomponenten überprüft werden muss.The secure defense of a means of manipulated firmware components launched attack thus requires that the firmware of all participating subsystems and sub-components must be checked.

In der Vergangenheit war es häufig üblich, dass die Integrität der Firmware aus solchen Sicherheitserwägungen nicht betrachtet werden musste, weil eine Programmierung der Firmware über sogenannte Metallmasken bei der Herstellung der Chips erfolgte oder im Fall sogenannter Flash-Speicherbereiche eine Umprogrammierung konstruktiv bedingt nur auf den Fertigungsanlagen des Geräteherstellers einer Komponente möglich war. Heute ist jedoch Stand der Technik, dass auch im Feldeinsatz das Einspielen einer neuen Firmware auf alle Teilkomponenten, ein sogenanntes Firmware-Update, jederzeit zur Laufzeit möglich ist.In the past, it was often common that the integrity of the firmware for such security considerations did not have to be considered because a programming of the firmware via so-called metal masks in the production of the chips was done or in the case of so-called flash memory areas, a design-related only on the production lines device manufacturer of a component was possible. Today, however, the state of the art that even in field use the loading of a new firmware on all sub-components, a so-called firmware update, at any time at runtime is possible.

Zur Sicherstellung der Gesamtintegrität des Systems ist somit die Sicherstellung der Integrität ausnahmslos aller beteiligten Firmware-Komponenten entscheidend.To ensure the overall integrity of the system, ensuring the integrity of all involved firmware components is crucial.

Das hat zur Konsequenz, dass sowohl „große“ Systeme mit viel Speicher als auch sehr rechenschwache Mikrocontroller-Systeme abgesichert werden müssen. Im kryptographischen Kontext wird dabei von der erforderlichen sogenannten Authentizität der Firmware gesprochen, bei der das empfangende System überprüft, dass die im Rahmen des Updates zu empfangende Firmware-Komponente authentisch ist, d.h. z.B. wirklich vom Gerätehersteller und nicht von einem möglichen Angreifer erstellt wurde.The consequence of this is that both "large" systems with a lot of memory and very low-power microcontroller systems have to be protected. In the cryptographic context is in this case spoken of the required so-called authenticity of the firmware, in which the receiving system checks that the firmware component to be received in the update is authentic, ie, for example, was really created by the device manufacturer and not by a possible attacker.

Bezüglich der kryptographischen Authentizitätsprüfung lassen sich zwei große Familien unterscheiden

  • – Symmetrische Prüfsummenverfahren mit Authentifizierungscodes (sogenannte Message Authentication Codes, Abkürzung: MAC), wie AES-CBC, HMAC-MD5, HMAC-SHA256, Chaskey, Chaskey-LTS, Galois-Feldbasierte MACs wie die Authentifizierungskomponente in AES-GCM, sowie Primzahlbasierte Verfahren wie Poly1305, etc.
  • – Asymmetrische Signaturverfahren, wie RSA-basierte Signaturen, ECDH-Signaturen auf elliptischen Kurven, EdDSA-Signaturen, Hash-Basierte Signaturverfahren, DSA-Signaturen, etc.
With regard to the cryptographic authenticity check, two large families can be distinguished
  • - Symmetric checksum methods with authentication codes (so-called message authentication codes, abbreviation: MAC), such as AES-CBC, HMAC-MD5, HMAC-SHA256, Chaskey, Chaskey-LTS, Galois field-based MACs such as the authentication component in AES-GCM, and primes-based methods like Poly1305, etc.
  • - Asymmetric signature techniques, such as RSA-based signatures, ECDH signatures on elliptic curves, EdDSA signatures, hash-based signatures, DSA signatures, etc.

Beide Verfahrensklassen können dazu genutzt werden mittels kryptographischer Verfahren, im Folgenden auch als Kryptoverfahren bezeichnet, eine Authentifizierungsinformation, z.B. eine Prüfsumme oder eine digitale Signatur, zu generieren, die zusammen mit der der Firmware-Aktualisierung eines Systems dienenden Firmware-Komponente ausgeliefert werden kann. Das empfangende System kann dann anhand der Authentifizierungsinformation und von Schlüsselinformationen überprüfen, ob die gelieferte Firmware-Komponente authentisch ist oder nicht.Both classes of methods can be used for this purpose by means of cryptographic methods, also referred to below as crypto methods, authentication information, e.g. generate a checksum or a digital signature that can be shipped with the firmware update of a system serving firmware component. The receiving system can then check, based on the authentication information and key information, whether the delivered firmware component is authentic or not.

Die beiden oben genannten Verfahrensklassen unterscheiden sich auf der einen Seite dadurch, dass bei symmetrischen Verfahren sowohl für die Generierung der Authentifizierungsinformation als auch für die Prüfung der Authentifizierungsinformation exakt der gleiche Schlüssel zum Einsatz kommt, während bei asymmetrischen Verfahren verschiedene Schlüssel verwendet werden. Auf der anderen Seite unterscheiden sich die beiden Verfahrensklassen in ihrer Komplexität und entsprechend ihrem Bedarf an Rechenzeit und/oder Speicher und der Codegröße der in Software implementierten Verfahren.The two method classes mentioned above differ on the one hand in that, in symmetrical methods, exactly the same key is used both for generating the authentication information and for checking the authentication information, while different keys are used in asymmetrical methods. On the other hand, the two classes of methods differ in their complexity and according to their need for computation time and / or memory and the code size of the methods implemented in software.

Bei symmetrischen Verfahren ist jede Entität, die in der Lage ist eine Authentizitätsprüfung durchzuführen, selbst ebenfalls in der Lage eine korrekte Prüfsumme als Authentifizierungsinformation zu generieren, da der verwendete Schlüssel „symmetrisch“ beiden beteiligten Partnern zur Verfügung stehen muss. Bei den asymmetrischen Verfahren liegen auf beiden Seiten (Generierung und Prüfung) unterschiedliche Schlüssel vor.In symmetric methods, any entity that is able to perform an authenticity check is also able to generate a correct checksum as authentication information, since the used key must be "symmetric" available to both partners involved. In asymmetric methods, there are different keys on both sides (generation and testing).

Die symmetrischen Prüfsummenverfahren sind heute aus Sicht vieler Kryptographen so stabil und sicher, dass mathematische Angriffe auf die Basisalgorithmen praktisch ausgeschlossen werden können, wenn Schlüssellängen von mehr als 80 Bits verwendet werden. Häufig werden heute symmetrische Schlüssel von mindestens 128 oder 256 Bit Länge empfohlen.The symmetric checksum methods are today so stable and secure from the point of view of many cryptographers that mathematical attacks on the basic algorithms can practically be ruled out if key lengths of more than 80 bits are used. Frequently symmetric keys of at least 128 or 256 bits in length are recommended today.

Im Kontext von Systemen mit kleinen Mikrocontrollern besteht jedoch bei symmetrischen Verfahren ein wesentliches Problem. Für die Prüfung der Authentizität einer neu angebotenen Firmware-Komponente ist es nötig, dass der symmetrische Schlüssel im persistenten Speicher des Systems vorgehalten wird. Bei konventionellen Mikrocontrollern kann dieser Speicher jedoch nicht wirksam gegen unberechtigtes Auslesen geschützt werden. Zwar gibt es elektronische Bausteine aus der sogenannten Smart-Card-IC-Klasse, die z.B. durch spezielle Metallüberdeckungen von Speicherbereichen und ausgefeilte Schutzmechanismen den persistenten Speicher eines Controllers gegen unberechtigten Zugriff schützen. In handelsüblichen Mikrocontrollern sind solche Gegenmaßnahmen jedoch nicht umgesetzt.However, in the context of systems with small microcontrollers, there is a significant problem with symmetric methods. To verify the authenticity of a newly offered firmware component, it is necessary to have the symmetric key held in the persistent storage of the system. In conventional microcontrollers, however, this memory can not be effectively protected against unauthorized reading. Although there are electronic components from the so-called smart card IC class, the e.g. Protect the persistent memory of a controller against unauthorized access by special metal covers of memory areas and sophisticated protection mechanisms. In commercial microcontrollers, however, such countermeasures are not implemented.

Damit wird einem Angreifer relativ leicht ermöglicht, sich die symmetrische Schlüsselinformation unberechtigterweise zu beschaffen, z.B. durch Öffnen des Gehäuses oder durch Umgehung der Zugangsbeschränkung eines Interfaces zur Software-Fehlersuche (Debugger-Interface). Der Angreifer kann dann leicht eine korrekte Prüfsumme für seine manipulierte Firmware-Komponente generieren und diese einem Teilsystem ohne Verursachen eines Fehlers unterschieben.This relatively easily allows an attacker to obtain the symmetric key information without authorization, e.g. by opening the housing or by bypassing the access restriction of an interface for software debugging (debugger interface). The attacker can then easily generate a correct checksum for its manipulated firmware component and defer it to a subsystem without causing a fault.

Der wesentliche Vorteil der symmetrischen Verfahren besteht darin, dass diese auch auf Systemen mit geringer Rechenleistung effizient implementiert werden können. Insbesondere wird hierfür nur sehr wenig Quellcode und CPU-Leistung benötigt. So kann beispielsweise ein MAC-Algorithmus wie Chaskey-LTS auf einer ARM-Cortex-M0 CPU bereits mit ca. 512 Bytes Programmlänge implementiert werden. Im Unterschied zu asymmetrischen Signaturverfahren wird z.B. nicht zwingend ein sogenannter kollisionsresistenter Hash-Algorithmus als Teilkomponente benötigt, der typisch größere Konstantentabellen und relativ viel Programmcode erfordert.The main advantage of the symmetric methods is that they can be efficiently implemented even on systems with low computing power. In particular, this requires very little source code and CPU power. For example, a MAC algorithm such as Chaskey-LTS on an ARM Cortex-M0 CPU can already be implemented with approximately 512 bytes of program length. Unlike asymmetric signature methods, e.g. not necessarily a so-called collision-resistant hash algorithm is needed as a subcomponent, which typically requires larger constant tables and relatively much program code.

Der wesentliche Unterschied zwischen symmetrischen und asymmetrischen Verfahren besteht darin, dass bei asymmetrischen Verfahren für die Generierung einer Signatur als Authentifizierungsinformation ein anderer Schlüssel zum Einsatz kommt, als für die Überprüfung der Signatur. Dabei wird in der Regel der Schlüssel für die Signaturgenerierung als „privater“ Schlüssel bezeichnet und der für die Überprüfung der Signatur verwendete Schlüssel als „öffentlicher“ Schlüssel. Der zur Signatur einer Firmware-Komponente verwendete private Schlüssel kann so ausschließlich in einer sicheren Umgebung behalten werden, z.B. innerhalb eines zugangsbeschränkten Bereichs innerhalb der Entwicklungsabteilung beim Gerätehersteller. Dieser private Schlüssel kann somit viel effektiver vor potentiellen Angreifern geschützt werden als ein in einem ungeschützten Speicher in einem Feldgerät abgelegter Schlüssel. Innerhalb des persistenten Speichers der Mikrocontroller umfassenden Systeme der Geräte befindet sich bei Nutzung einer asymmetrischen Signatur nur der unkritische öffentliche Schlüssel, der von einem Angreifer nicht dazu verwendet werden kann, selbst eine manipulierte Firmware zu signieren.The main difference between symmetric and asymmetric methods is that in asymmetric methods for generating a signature as authentication information another key is used, as for the verification of the signature. In this case, the key for the generation of the signature is usually referred to as a "private" key and the key used to verify the signature as a "public" key. The private key used for the signature of a firmware component can thus be kept exclusively in a secure environment, for example within an access-restricted area within the development department at the device manufacturer. This private key can thus be protected much more effectively from potential attackers than a key stored in an unprotected memory in a field device. Within the persistent memory of the device's microcontroller systems, when using an asymmetric signature, there is only the non-critical public key that can not be used by an attacker to even sign manipulated firmware.

Für asymmetrische Verfahren sind aus Betrachtung der möglichen Angriffe gegen die mathematischen Verfahren heute Schlüssellängen von mindestens 2048 Bits (bei Verfahren wie DSA oder RSA auf Basis von Verfahren auf Basis der Faktorisierung großer Zahlen und Gruppen auf Primzahlkörpern) oder > 230 Bits für Verfahren auf Basis von elliptischen Kurven erforderlich. Alternative Verfahren, wie z.B. die sogenannten Merkle-Signaturen auf Basis von Hash-Bäumen, Code-Basierte Signaturen (McEliece) oder sogenannte gitterbasierte Signaturverfahren (z.B. LWE, Learning with Errors) erfordern noch weit längere Schlüssel von 10 kByte und mehr und werden deswegen in der Praxis nicht häufig eingesetzt. Im Kontext von rechenleistungsstarken Systemen, wie z.B. Webservern im Internet finden Signaturen auf Basis von Verfahren wie RSA, DSA oder ECDSA weiten Einsatz, z.B. bei sogenannten Zertifikaten, wie sie bei verschlüsselten Protokollen wie HTTPs oder TLS zum Einsatz kommen.For asymmetric techniques, from a consideration of possible attacks against the mathematical methods today, key lengths of at least 2048 bits (in methods such as DSA or RSA based on factorization of large numbers and groups on prime number fields) or> 230 bits for methods based on elliptic curves required. Alternative methods, such as the so-called Merkel signatures based on hash trees, code-based signatures (McEliece) or so-called grid-based signature methods (eg LWE, learning with errors) still require much longer keys of 10 kbytes and more and are therefore not widely used in practice , In the context of computationally powerful systems, e.g. Web servers on the Internet find signatures based on methods such as RSA, DSA or ECDSA, e.g. with so-called certificates, as used in encrypted protocols such as HTTPs or TLS.

Die Herausforderung besteht darin, dass diese Verfahren wegen der aufwändigen Algorithmen und großen Schlüssellängen erheblich mehr Rechenressourcen benötigen, als symmetrische Verfahren. So braucht z.B. selbst eine hoch optimierte Software-Implementierung von asymmetrischer Kryptographie auf kleinen Microcontrollern bereits ca. 10 kByte Speicher ( Des. Codes Cryptogr. (2015) 77:493–514 ). Es ist im Vergleich zu symmetrischen Verfahren daher mindestens mit einem 10 bis 100fachen Speicherbedarf für den zugehörigen Programmcode zu rechnen.The challenge is that these algorithms require significantly more computational resources than symmetric algorithms because of the elaborate algorithms and large key lengths. For example, even a highly optimized software implementation of asymmetric cryptography on small microcontrollers already needs about 10 kbytes of memory ( Of. Codes Cryptogr. (2015) 77: 493-514 ). Therefore, in comparison to symmetrical methods, at least a 10 to 100 times memory requirement for the associated program code can be expected.

Innerhalb eines industriellen Steuerungsgeräts gibt es typisch einzelne Komponenten, welche für die Standardverfahren ausreichende Ressourcen bereitstellen. Z.B. könnte innerhalb eines pH-Sensors eine für die Feldbuskommunikation verantwortliche CPU über ausreichend Speicher und Rechenleistung verfügen. Wie oben ausgeführt, reicht jedoch die Absicherung eines einzelnen Teilsystems nicht aus. Vielmehr müssen alle beteiligten Firmware-Komponenten geschützt werden, auch in den kleineren Subsystemen, z.B. für die Analog-Digitalwandlung nahe beim physikalischen Messwandler.Within an industrial control device, there are typically individual components that provide sufficient resources for the standard methods. For example, Within a pH sensor, a CPU responsible for fieldbus communication could have sufficient memory and computing power. However, as stated above, hedging a single subsystem is not enough. Rather, all involved firmware components must be protected, even in the smaller subsystems, e.g. for analog-to-digital conversion close to the physical transducer.

Die Auslagerung der Signaturprüfung allein auf die rechenstarken CPUs einer Komponente birgt die Gefahr, dass Fehler innerhalb der Protokolle innerhalb einer Komponente sich auf die anderen Komponenten auswirken können. D.h. die Sicherheit einer Firmware-Komponente (z.B. zur A/D-Wandlung) hängt dann von der Korrektheit einer anderen Firmware-Komponente (z.B. Feldbus-CPU) ab, die ggf. unter Kontrolle einer anderen Organisationseinheit oder sogar einer Fremdfirma steht und nicht überprüft werden kann. Das erhöht die Menge möglicher Fehlerquellen bei Konzept und Implementierung.Outsourcing the signature check to just the high-performance CPUs of a component runs the risk that errors within the logs within one component can affect the other components. That The security of a firmware component (eg for A / D conversion) then depends on the correctness of another firmware component (eg fieldbus CPU), which may be under the control of another organizational unit or even a third-party company and are not checked can. This increases the amount of possible sources of error in concept and implementation.

Für das Merkmal der Sicherheit sind immer Systeme geringer Komplexität anzustreben. Diese ist in der Praxis vielfach nur dann erreicht, wenn jede CPU bei einem Firmware-Update vollständig selbst für die Firmware-Authentizitätsprüfung verantwortlich ist, die Prüfung also dezentral erfolgt. In der Praxis können häufig nur so sichere Systeme designt werden.For the safety feature, systems of low complexity are always desirable. In practice, this is often only achieved if each CPU is completely responsible for the firmware authenticity check during a firmware update, so the check is done decentrally. In practice, only such secure systems can often be designed.

Für den Prozess eines Firmware-Updates in einem eingebetteten System sind folgende Betrachtungen bedeutsam. Das Rechensystem besteht in der Regel aus einer Recheneinheit sowie einem RAM – Speicher für dynamische Daten und einem (Flash-)ROM-Speicher für zu persistierende Daten. Die Recheneinheit (CPU) bezieht aus dem ROM-Speicher die Maschineninstruktionen und legt dort auch persistente Daten, wie z.B. kryptographische Schlüssel ab. Heute ist Stand der Technik, dass Mikrocontroller über einen integrierten ROM-Speicher in sogenannter Flash-Technik verfügen. In der Regel dominiert der Flash-Speicher die Silizium-Fläche der Mikrocontroller und ist damit der entscheidende Kostenfaktor bei der Herstellung der Mikrocontroller-Chips. Aus Kostengründen werden daher in der Regel Bausteine eingesetzt, welche genau auf den gerade eben benötigten Speicherbedarf zugeschnitten sind. Ein typisches eingebettetes System verfügt damit in der Regel nicht über ausreichend RAM- und Flash-ROM-Speicher um während eines Firmware-Updates temporär sowohl die bisherige als auch die „neue“ Firmware-Komponente ablegen zu können.For the process of firmware update in an embedded system, the following considerations are significant. The computing system usually consists of a computing unit and a RAM memory for dynamic data and a (flash) ROM memory for data to be persisted. The arithmetic unit (CPU) obtains the machine instructions from the ROM memory and also stores there persistent data, such as. cryptographic keys. Today, the state of the art is that microcontrollers have an integrated ROM memory in so-called flash technology. As a rule, the flash memory dominates the silicon area of the microcontroller and is therefore the decisive cost factor in the production of the microcontroller chips. For cost reasons, therefore, building blocks are usually used, which are tailored to the just needed storage space. As a rule, a typical embedded system does not have enough RAM and flash ROM memory to temporarily store both the previous and the "new" firmware components during a firmware update.

Aus diesem Grund wird in der Regel zwischen zwei Firmware-Komponenten, einer sogenannten Bootloader-Komponente (im Folgenden auch kurz als Bootloader bezeichnet) und einer Applikations-Komponente (im Folgenden auch kurz als Applikation bezeichnet), unterschieden. Bei einem typischen Mikrocontroller mit z.B. 64 kByte Flash-Speicher insgesamt besteht die Gesamtfirmware z.B. aus einem Bootloader mit z.B. 4 kByte Flash und einer Applikation mit 59 kByte Flash und 1 kByte Datenspeicher.For this reason, a distinction is generally made between two firmware components, a so-called bootloader component (also referred to below as bootloader for short) and an application component (also referred to below as an application in the following). In a typical microcontroller with e.g. 64 kbytes of flash memory in total, the overall firmware consists e.g. from a bootloader with e.g. 4 kByte Flash and an application with 59 kByte Flash and 1 kByte data memory.

Die Aufgabe des Bootloaders besteht dabei darin, einen Austausch der Applikations-Firmware zu ermöglichen. Zu diesem Zweck wird vom Bootloader der Applikationsbereich des Flashs zunächst gelöscht. Vielfach wird in Microcontrollern dabei hardwaremäßig das Flash in eine sogenannte „Bootloader“-Sektion und eine „Applikations“-Sektion getrennt, wobei Bootloader- und Applikationsteile separat gelöscht werden können. In solchen Systemen ist damit die maximal mögliche Größe des Bootloaders durch die Hardware auf Längen von typisch 4 oder 8 kByte beschränkt. Nach dem Löschvorgang ist die Applikation nicht mehr verfügbar. Anschließend wird dem Bootloader über ein externes Dateninterface eine neue Applikations-Firmware übermittelt und dann in den Flash-Speicher neu abgelegt. The task of the bootloader is to enable an exchange of the application firmware. For this purpose, the bootloader first deletes the application area of the flash. In many cases, in microcontrollers, the flash is separated into a so-called "bootloader" section and an "application" section, whereby bootloader and application parts can be deleted separately. In such systems, the maximum possible size of the bootloader is limited by the hardware to lengths of typically 4 or 8 kbytes. After deleting the application is no longer available. Subsequently, a new application firmware is transmitted to the bootloader via an external data interface and then stored again in the flash memory.

Wichtig im Kontext der Generierung und/oder Prüfung kryptographischer Authentifizierungsinformationen ist dabei, dass für die Generierung und die Überprüfung einer Authentifizierungsinformation die vollständige beim Update übermittelte Firmware-Komponente herangezogen werden muss. Aus offensichtlichen Gründen ist bei der voranstehend beschriebenen Form des Firmware-Updates eine Überprüfung der Authentifizierungsinformation vom Bootloader-Teil der Software erforderlich.Important in the context of generation and / or verification of cryptographic authentication information is that for the generation and verification of authentication information the full firmware component transmitted during the update must be used. For obvious reasons, in the above-described form of firmware update, verification of the authentication information from the bootloader portion of the software is required.

Wie man leicht aus dem oben genannten typischen Beispiel entnehmen kann ist es absehbar nicht möglich, sichere asymmetrische Kryptographieverfahren (mit typisch mindestens 10 kByte Codelänge) unter den Randbedingungen der Codegrößen-Beschränkungen des Bootloaders zu implementieren. Im Kontext der normalen Applikation (im Beispiel 59 kByte Code) sind solche Verfahren jedoch sehr wohl umzusetzen.As can be easily seen from the above typical example, it is not foreseen to be able to implement secure asymmetric cryptography techniques (typically with at least 10 Kbytes of code length) under the constraints of the code size limitations of the bootloader. In the context of the normal application (in the example 59 kByte code), however, such methods are very well implemented.

Die Aufgabe der Erfindung besteht zusammenfassend darin, im genannten Kontext, eine dezentrale, sichere, asymmetrische Signaturprüfung zu ermöglichen, auch in Teilkomponenten mit geringer Rechenleistung, insbesondere unter den Beschränkungen einer Bootloader-Firmware.In summary, the object of the invention is to allow a decentralized, secure, asymmetric signature check in the mentioned context, even in subcomponents with low computing power, in particular under the limitations of a boot loader firmware.

Diese Aufgabe wird gelöst durch ein Verfahren mit den Merkmalen des Anspruchs 1 und ein Gerät der Mess- und Regeltechnik gemäß Anspruch 11. Vorteilhafte Ausgestaltungen sind in den Unteransprüchen angegeben.This object is achieved by a method having the features of claim 1 and a device of measurement and control technology according to claim 11. Advantageous embodiments are specified in the subclaims.

Das erfindungsgemäße Verfahren zum Aktualisieren einer die Funktionalität eines Geräts der Mess- und Regeltechnik bereitstellenden ersten Firmware-Komponente, welche in einen Mikrocontroller des Geräts eingebettet ist, umfasst:

  • – Segmentweises Empfangen eines ersten Firmware-Images über ein mit einem externen Gerät verbundenes Dateninterface des Mikrocontrollers, wobei das erste Firmware-Image einen Datenbereich und ein Signaturfeld umfasst, und wobei der Datenbereich zur Aktualisierung der ersten Firmware-Komponente dienende, einen Firmware-Programmcode umfassende Daten enthält und das Signaturfeld eine nach einem ersten Kryptoverfahren erzeugte erste Authentifizierungsinformation enthält;
  • – Durchführen einer Authentifizierung des ersten Firmware-Images anhand der ersten Authentifizierungsinformation mittels eines von der ersten Firmware-Komponente umfassten Authentifizierungs-Algorithmus nach dem ersten Kryptoverfahren;
  • – Erzeugen einer zweiten Authentifizierungsinformation für die im Datenbereich des ersten Firmware-images enthaltenen Daten mittels eines von der ersten Firmware-Komponente umfassten Algorithmus zur Erzeugung der zweiten Authentifizierungsinformation nach einem von dem ersten Kryptoverfahren verschiedenen, zweiten Kryptoverfahren;
  • – nach erfolgreicher Authentifizierung des ersten Firmware-Images Speichern der zweiten Authentifizierungsinformation in einem persistenten Speicher des Geräts;
  • – Löschen der ersten Firmware-Komponente, wobei das Löschen durch eine in den Mikrocontroller eingebettete zweite Firmware-Komponente gesteuert wird;
  • – erneute Übertragung der zur Aktualisierung der ersten Firmware-Komponente dienenden Daten als Bestandteil eines zweiten Firmware-Images unter Beteiligung der zweiten Firmware-Komponente über das Dateninterface an den Mikrocontroller und Speichern der Daten im persistenten Speicher des Mikrocontrollers;
  • – Durchführen einer Authentifizierung des bei der erneuten Übertragung empfangenen zweiten Firmware-Images anhand der in dem Mikrocontroller gespeicherten zweiten Authentifizierungsinformation mittels eines von der zweiten Firmware-Komponente umfassten Authentifizierungs-Algorithmus nach dem zweiten Kryptoverfahren, und
  • – für den Fall einer erfolgreichen Authentifizierung des zweiten Firmware-Images Aktivschalten und Ausführen des mit dem zweiten Firmware-Image übertragenen und gespeicherten Firmware-Programmcodes als neue erste Firmware-Komponente.
The method according to the invention for updating a first firmware component which provides the functionality of a device of the measurement and control technology and which is embedded in a microcontroller of the device comprises:
  • Receiving a first firmware image segment by segment via a data interface of the microcontroller connected to an external device, wherein the first firmware image comprises a data area and a signature field, and wherein the data area is for updating the first firmware component comprising a firmware program code Contains data and the signature field contains a first authentication information generated after a first crypto procedure;
  • Performing authentication of the first firmware image based on the first authentication information using an authentication algorithm included in the first firmware component after the first crypto-method;
  • Generating second authentication information for the data contained in the data area of the first firmware image by means of an algorithm comprised by the first firmware component for generating the second authentication information according to a second crypto method different from the first crypto method;
  • After successful authentication of the first firmware image, storing the second authentication information in a persistent memory of the device;
  • Deleting the first firmware component, wherein the deletion is controlled by a second firmware component embedded in the microcontroller;
  • Retransmission of the data used to update the first firmware component as part of a second firmware image involving the second firmware component via the data interface to the microcontroller and storing the data in the persistent memory of the microcontroller;
  • Performing an authentication of the second firmware image received during retransmission based on the second authentication information stored in the microcontroller by means of an authentication algorithm included in the second firmware component according to the second crypto method, and
  • - in the case of a successful authentication of the second firmware image, activating and executing the firmware program code transmitted and stored with the second firmware image as the new first firmware component.

Der Erfindung liegt die Erkenntnis zugrunde, dass für eine ressourcenbeschränkte Firmware-Komponente, wie z.B. den einleitend beschriebenen Bootloader, im Unterschied zu asymmetrischen Kryptoverfahren, weniger aufwändige Kryptoverfahren, wie z.B. symmetrische Prüfsummenverfahren zur Prüfsummenüberprüfung sehr wohl in Reichweite liegen. Dies gilt insbesondere bei Nutzung sogenannter „lightweight“-Algorithmen wie Chaskey, Chaskey-LTS oder sogenannte Cipher Block Chaining(CBC)-Authentifizierungs-Codes auf Basis von light-weight Block-Cipher-Algorithmen wie „Simon“ oder „Speck“ (siehe auch National Institute Of Standards and Technology NIST), oder für den Fall, dass der entsprechende Mikrocontroller Crypto-Beschleuniger-Hardware enthält, z.B. für AES.The invention is based on the finding that for a resource-limited firmware component, such as the bootloader described in the introduction, in contrast to asymmetric crypto methods, less expensive crypto methods, such as symmetric checksum methods for checksum checking, are well within reach. This is especially true when using so-called "lightweight" algorithms such as Chaskey, Chaskey LTS or so-called cipher block Chaining (CBC) authentication codes based on light-weight block cipher algorithms such as "Simon" or "Speck" (see also National Institute of Standards and Technology NIST), or in case the corresponding microcontroller Crypto- Accelerator hardware, eg for AES.

Indem die erste Firmware-Komponente eine Authentifizierung des ersten Firmware-Images nach einem Authentifizierungs-Algorithmus basierend auf einem ersten Kryptoverfahren durchführt, gleichzeitig unter Verwendung des ersten Firmware-Images eine Authentifizierungsinformation nach einem vom ersten Kryptoverfahren verschiedenen, zweiten Kryptoverfahren generiert, und die bei der erneuten Übertragung mit dem zweite Firmware-Image erhaltenen Daten von der zweiten Firmware-Komponente anhand der von der ersten Firmware-Komponente generierten Authentifizierungsinformation authentifiziert werden können, bietet sich die Möglichkeit, als erstes Kryptoverfahren ein komplexeres, und damit sichereres, Kryptoverfahren zu verwenden, und als zweites Kryptoverfahren ein einfacheres und damit weniger Ressourcen benötigendes Kryptoverfahren zu verwenden. Die Authentifizierung durch die erste Firmware-Komponente kann somit durch ein aufwändiges, beispielsweise asymmetrisches, Kryptoverfahren sicherstellen, dass bei der ersten Übertragung der Daten mit dem ersten Firmware-Image Manipulationen durch einen Angreifer ausgeschlossen sind. Die Authentifizierung durch die zweite Firmware-Komponente stellt sicher, dass die beim erneuten Übersenden mit dem zweiten Firmware-Image erhaltenen Daten mit den bei der ersten Übertragung erhaltenen Daten des ersten Firmware-Images identisch sind. Somit genügt hierfür ein weniger aufwändiges, z.B. ein symmetrisches, Kryptoverfahren.By performing authentication of the first firmware image according to an authentication algorithm based on a first crypto method, the first firmware component simultaneously generates authentication information according to a second crypto method different from the first crypto method using the first firmware image; re-transmission of data obtained by the second firmware image from the second firmware component can be authenticated using the authentication information generated by the first firmware component, it is possible to use a more complex, and thus safer, crypto method as the first crypto method As a second crypto-method to use a simpler and thus less resource-requiring crypto-driving. The authentication by the first firmware component can thus ensure by a complex, for example, asymmetric, crypto procedure that manipulations by an attacker are excluded during the first transmission of the data with the first firmware image. Authentication by the second firmware component ensures that the data received when retransmitting with the second firmware image is identical to the data of the first firmware image obtained during the first transmission. Thus, a less expensive, e.g. a symmetric, crypto method.

Das Verfahren lässt sich daher vorteilhaft bei einem Firmware-Update, wie es eingangs beschrieben wurde, anwenden. In diesem Fall entspricht die erste Firmware-Komponente der Applikation, die zweite Firmware-Komponente dem Bootloader.The method can therefore be advantageously used in a firmware update, as described at the beginning. In this case, the first firmware component corresponds to the application, the second firmware component to the bootloader.

Mit dem Begriff Firmware-Image wird hier eine geeignete Kombination eines Datenbereichs, der einen Firmware-Programmcode und konstante Daten enthalten kann, und einem optional vorhandenen Signaturfeld bezeichnet. Die in dem Datenbereich enthaltenen Daten werden im Folgenden auch als Firmware-Daten oder kurz als Firmware bezeichnet. Das erste Firmware-Image umfasst ein Signaturfeld, das die erste Authentifizierungsinformation enthält. Das zweite Firmware-Image kann ein Signaturfeld mit einer Authentifizierungsinformation, insbesondere der ersten Authentifizierungsinformation, enthalten. Insbesondere kann es mit dem ersten Firmware-Image vollständig übereinstimmen, d.h. dass bei dem oben beschriebenen Verfahren ein und dasselbe Firmware-Image zweimal übertragen wird, nämlich beim ersten Mal an die erste Firmwarekomponente zur Authentifizierung nach dem ersten Kryptoverfahren und zur Generierung der zweiten Authentifizierungsinformation und beim zweiten Mal an die zweite Firmwarekomponente zur beschriebenen Authentifizierung anhand der von der ersten Firmwarekomponente generierten zweiten Authentifizierungsinformation. Es ist aber auch möglich, dass das zweite Firmware-Image nur einen Datenbereich mit den Firmware-Daten enthält.The term firmware image here denotes a suitable combination of a data area, which may contain a firmware program code and constant data, and an optionally existing signature field. The data contained in the data area are also referred to below as firmware data or firmware for short. The first firmware image includes a signature field containing the first authentication information. The second firmware image may include a signature field with authentication information, in particular the first authentication information. In particular, it may completely match the first firmware image, i. that in the above-described method one and the same firmware image is transmitted twice, namely the first time to the first firmware component for authentication after the first crypto-process and for generating the second authentication information and the second time to the second firmware component for the authentication described by means of the first firmware component generated second authentication information. But it is also possible that the second firmware image contains only one data area with the firmware data.

Das Verfahren kann weiter umfassen:
für den Fall einer nicht erfolgreichen Authentifizierung des zweiten Firmware-Images, Löschen der mit dem zweiten Firmware-Image übertragenen und gespeicherten Daten, insbesondere des gespeicherten Firmware-Programmcodes.
The method may further comprise:
in the case of an unsuccessful authentication of the second firmware image, deleting the data transmitted and stored with the second firmware image, in particular the stored firmware program code.

Unter einer erfolgreichen Authentifizierung wird hier verstanden, dass der Authentifizierungsalgorithmus zu dem Ergebnis führt, dass das zu authentifizierende Firmware-Image bzw die enthaltenen Daten authentisch ist/sind.Here, a successful authentication means that the authentication algorithm leads to the result that the firmware image or the data contained in it is / are authentic.

In einer vorteilhaften Ausgestaltung erfordert der von der ersten Firmware-Komponente umfasste Authentifizierungs-Algorithmus nach dem ersten Kryptoverfahren einen Speicherbedarf von mehr als 5 kByte ROM und von 512 Bytes RAM.In an advantageous embodiment, the authentication algorithm encompassed by the first firmware component requires, after the first crypto method, a memory requirement of more than 5 kbytes of ROM and 512 bytes of RAM.

In einer weiteren vorteilhaften Ausgestaltung erfordert der von der ersten Firmware-Komponente umfasste Algorithmus zur Erzeugung der zweiten Authentifizierungsinformation nach dem zweiten Kryptoverfahren und der von der zweiten Firmware-Komponente umfasste Authentifizierungs-Algorithmus nach dem zweiten Kryptoverfahren einen Speicherbedarf von weniger als 512 Bytes RAM und 1 kBytes ROM.In a further advantageous embodiment, the algorithm encompassed by the first firmware component for generating the second authentication information according to the second crypto method and the authentication algorithm included in the second firmware component requires a memory requirement of less than 512 bytes RAM and 1 according to the second crypto method kBytes ROM.

Das erste Kryptoverfahren kann beispielsweise ein asymmetrisches Kryptoverfahren sein. In Frage kommt z.B. ein Verfahren auf Basis von Elliptischen Kurven, insbesondere auf Basis des EdDSA-Algorithmus auf der elliptischen Kurve Curve25519, eines Verfahrens der ECDSA-Standardfamilie oder ein Verfahren auf der Basis von Primzahlkörpern, insbesondere ein RSA- oder DSA-Verfahren.The first crypto method may be, for example, an asymmetric crypto method. In question, for example, a method based on elliptic curves, in particular based on the EdDSA algorithm on the elliptic curve Curve25519, a method of the ECDSA standard family or a method based on prime number bodies, in particular an RSA or DSA method.

Das zweite Kryptoverfahren kann beispielsweise ein symmetrisches Kryptoverfahren sein. Geeignet ist beispielsweise ein MAC-Verfahren auf Basis eines Blockverschlüsselungsalgorithmus, insbesondere ein Verfahren auf Basis der Algorithmenfamilie Chaskey oder AES128-CBC.The second crypto method may be, for example, a symmetric crypto method. Suitable, for example, is a MAC method based on a block encryption algorithm, in particular a method based on the algorithm family Chaskey or AES128-CBC.

Die erste Authentifizierungsinformation kann eine mit einem privaten Schlüssel unter Verwendung der in dem Datenbereich enthaltenen Daten, insbesondere des Firmware-Programmcodes, erzeugte digitale Signatur sein, wobei das Durchführen der Authentifizierung des ersten Firmware-Images eine Überprüfung der digitalen Signatur mittels eines in einem persistenten Speicher des Mikrocontrollers gespeicherten öffentlichen Schlüssels umfasst.The first authentication information may be a digital signature generated with a private key using the data contained in the data area, in particular the firmware program code, wherein the performing of the Authentication of the first firmware image comprises a verification of the digital signature by means of a stored in a persistent memory of the microcontroller public key.

Das Erzeugen der zweiten Authentifizierungsinformation umfasst in einer Ausgestaltung das Erzeugen einer als zweite Authentifizierungsinformation dienenden Prüfsumme nach dem zweiten Kryptoverfahren aus einem mittels eines von der ersten Firmware-Komponente umfassten Schlüsselgenerators erzeugten Schlüssels und der in dem Datenbereich enthaltenen Daten, insbesondere dem von dem ersten Firmware-Image umfassten Firmware-Programmcode.The generation of the second authentication information comprises, in one embodiment, generating a check-sum serving as second authentication information according to the second crypto-method from a key generated by means of a key generator comprised by the first firmware component and the data contained in the data area, in particular that from the first firmware Image included firmware program code.

Der mittels des Schlüsselgenerators erzeugte Schlüssel kann in einem persistenten Speicher des Mikrocontrollers abgespeichert werden, wobei das Durchführen einer Authentifizierung des zweiten Firmware-Images anhand der zweiten Authentifizierungsinformation folgende Schritte umfasst: Erzeugen einer Prüfsumme nach dem zweiten Kryptoverfahren aus dem mittels des Schlüsselgenerators erzeugten Schlüssel und der von dem zweiten Firmware-Image umfassten Daten, insbesondere dem von dem zweiten Firmware-Image umfassten Firmware-Programmcode; und Vergleichen der Prüfsumme mit der zweiten Authentifizierungsinformation, wobei die Authentifizierung erfolgreich ist, wenn die Prüfsumme mit der zweiten Authentifizierungsinformation übereinstimmt.The key generated by means of the key generator can be stored in a persistent memory of the microcontroller, wherein performing an authentication of the second firmware image based on the second authentication information comprises the steps of: generating a checksum according to the second crypto method from the key generated by the key generator and data comprised by the second firmware image, in particular the firmware program code comprised by the second firmware image; and comparing the checksum with the second authentication information, wherein the authentication is successful if the checksum matches the second authentication information.

In seltenen Fällen könnte es erstrebenswert sein, innerhalb des Firmware-Images auch Abschnitte zu definieren, welche zwar mit übertragen werden sollen, jedoch nicht kryptographisch abzugesichern sind, d.h. Abschnitte die bewusst nicht für die Berechnungen der Authentifizierungsinformationen herangezogen werden. Das könnte z.B. Datenbereiche umfassen, in denen nach erfolgter Signaturgenerierung erklärende Hinweistexte zur Firmware, wie z.B. eine nach Auslieferung der Software ergänzte Liste bekannter Fehler-Issues mit Beschreibung und empfohlenen Maßnahmen ergänzt werden. Diese Datenabschnitte können ggfs. von der Signaturprüfung nach dem ersten Kryptoverfahren bzw. von der Prüfsummengenerierung und Authentifizierung nach dem zweiten Kryptoverfahren ausgenommen werden.In rare cases, it may be desirable to define within the firmware image also sections, which are to be transferred, but are not cryptographically deducted, i. Sections that are deliberately not used for the calculation of the authentication information. This could e.g. Data areas in which, after the signature generation, explanatory notes to the firmware, such as e.g. a list of known error issues supplemented with software and supplements will be supplemented with description and recommended measures. If necessary, these data sections can be excluded from the signature check after the first crypto procedure or from the checksum generation and authentication according to the second crypto method.

Der Schlüsselgenerator kann beispielsweise einen Zufallszahlengenerator umfassen, wobei der Schlüssel eine Zufallszahlensequenz von vorzugsweise mindestens 80 Bits ist.The key generator may, for example, comprise a random number generator, the key being a random number sequence of preferably at least 80 bits.

Der Firmware-Programmcode des ersten und des zweiten Firmware-Images kann optional verschlüsselt sein. Das Verfahren umfasst in diesem Fall zusätzlich das Entschlüsseln des Firmware-Programmcodes mittels eines zusätzlichen Entschlüsselungs-Algorithmus der ersten und/oder der zweiten Firmware-Komponente. Hierfür würde vorteilhafterweise ein symmetrisches Verschlüsselungsverfahren zum Einsatz kommen, dessen Schlüssel im persistenten Speicher des Mikrocontrollers abgelegt ist.The firmware program code of the first and second firmware images may optionally be encrypted. In this case, the method additionally comprises the decryption of the firmware program code by means of an additional decryption algorithm of the first and / or the second firmware component. For this purpose, a symmetric encryption method would advantageously be used, the key is stored in the persistent memory of the microcontroller.

Die Erfindung umfasst auch ein Gerät der Mess- und Regeltechnik umfassend:
eine Geräteelektronik mit mindestens einem Mikrocontroller;
wobei der mindestens eine Mikrocontroller eine eingebettete Firmware umfasst, welche mindestens eine erste Firmware-Komponente und eine zweite Firmware-Komponente aufweist,
und wobei die erste Firmware-Komponente umfasst:

  • – einen oder mehrere Algorithmen zur Bereitstellung von Funktionalitäten des Geräts;
  • – einen Algorithmus zum Empfang eines ersten Firmware-Images, welches einen Datenbereich und ein Signaturfeld umfasst, wobei der Datenbereich zur Aktualisierung der ersten Firmware-Komponente dienende, einen Firmware-Programmcode umfassende, Daten enthält, und wobei das Signaturfeld eine nach einem ersten Kryptoverfahren erzeugte erste Authentifizierungsinformation enthält;
  • – einen Authentifizierungs-Algorithmus zur Authentifizierung des ersten Firmware-Images anhand der ersten Authentifizierungsinformation nach einem ersten Kryptoverfahren;
  • – einen Algorithmus zur Erzeugung einer zweiten Authentifizierungsinformation aus den in dem Datenbereich enthaltenen Daten, insbesondere dem Firmware-Programmcode, nach einem von dem ersten Kryptoverfahren verschiedenen, zweiten Kryptoverfahren; und
  • – einen Algorithmus zur Ablage der zweiten Authentifizierungsinformation in einem persistenten Speicher des Microcontrollers; und wobei die zweite Firmware-Komponente umfasst:
  • – einen Algorithmus zum Empfangen eines zweiten Firmware-Images, welches die zur Aktualisierung der ersten Firmware-Komponente dienenden Daten, insbesondere einen zur Aktualisierung der ersten Firmware-Komponente dienenden Firmware-Programmcode, umfasst;
  • – einen Algorithmus zum Löschen der ersten Firmware-Komponente und zum Speichern des von dem zweiten Firmware-Image umfassten Firmware-Programmcodes als neue ersten Firmware-Komponente;
  • – einen Algorithmus zum Auslesen der zweiten Authentifizierungsinformation aus dem persistenten Speicher;
  • – einen Authentifizierungsalgorithmus nach dem zweiten Kryptoverfahren zur Authentifizierung des zweiten Firmware-Images anhand der zweiten Authentifizierungsinformation und der von dem zweiten Firmware-Image umfassten Daten, insbesondere des Firmware-Programmcodes; und
  • – einen Algorithmus zum Aktivschalten der neuen ersten Firmware-Komponente.
The invention also encompasses a device of measurement and control technology comprising:
a device electronics with at least one microcontroller;
wherein the at least one microcontroller comprises embedded firmware having at least a first firmware component and a second firmware component,
and wherein the first firmware component comprises:
  • One or more algorithms for providing functionalities of the device;
  • An algorithm for receiving a first firmware image, comprising a data area and a signature field, the data area containing data for updating the first firmware component, comprising firmware program code, and wherein the signature field generates a first-cryptographic process contains first authentication information;
  • An authentication algorithm for authenticating the first firmware image based on the first authentication information after a first crypto procedure;
  • An algorithm for generating a second authentication information from the data contained in the data area, in particular the firmware program code, according to a second crypto method different from the first crypto method; and
  • An algorithm for storing the second authentication information in a persistent memory of the microcontroller; and wherein the second firmware component comprises:
  • An algorithm for receiving a second firmware image which comprises the data for updating the first firmware component, in particular a firmware program code for updating the first firmware component;
  • An algorithm for deleting the first firmware component and storing the firmware program code included in the second firmware image as a new first firmware component;
  • An algorithm for reading out the second authentication information from the persistent storage;
  • An authentication algorithm according to the second crypto method for authentication of the second firmware image based on the second authentication information and that of the second firmware image included data, in particular the firmware program code; and
  • An algorithm for activating the new first firmware component.

Das Gerät kann mithin zur Ausführung des voranstehend beschriebenen Verfahrens ausgestaltet sein.The device can therefore be designed to carry out the method described above.

Das erste Kryptoverfahren kann ein asymmetrisches Kryptoverfahren und das zweite Kryptoverfahren ein symmetrisches Kryptoverfahren sein. Die erste Firmware-Komponente kann weiter umfassen: einen einen Zufallszahlengenerator umfassenden Schlüsselgenerator und einen Algorithmus zur Ablage eines mittels des Schlüsselgenerators erzeugten Schlüssels für das zweite Kryptoverfahren in einem persistenten Speicher des Mikrocontrollers. Der Authentifizierungs-Algorithmus nach dem zweiten Kryptoverfahren kann dazu ausgestaltet sein, aus dem gespeicherten Schlüssel und dem Firmware-Programmcode eine Prüfsumme zu erzeugen und diese mit der zweiten Authentifizierungsinformation zu vergleichen.The first crypto method may be an asymmetric crypto method and the second crypto method may be a symmetric crypto method. The first firmware component may further comprise: a random number generator comprising a key generator and an algorithm for storing a key generated by the key generator for the second crypto method in a persistent memory of the microcontroller. The authentication algorithm according to the second crypto method may be configured to generate a checksum from the stored key and the firmware program code and to compare them with the second authentication information.

Die erste und/oder die zweite Firmware-Komponente können zusätzlich einen weiteren Algorithmus zur Entschlüsselung eines Firmware-Images oder der Daten, die in dem von dem Firmware-Image umfassten Datenbereich enthalten sind, insbesondere eines von dem Firmware-Image umfassten Firmware-Programmcodes, insbesondere mit einem symmetrischen Verschlüsselungsverfahren, umfassen.The first and / or the second firmware component can additionally comprise a further algorithm for decoding a firmware image or the data contained in the data area comprised by the firmware image, in particular a firmware program code comprised of the firmware image, in particular with a symmetric encryption method.

Die Übermittlung des ersten und/oder zweiten Firmware-Images an das Gerät kann auch unter Nutzung eines leicht angreifbaren Datenübermittlungskanals erfolgen, insbesondere unter Nutzung eines Fernwartungs- oder Funkinterfaces oder unter Verwendung eines transportablen Speichermediums, wie eines USB-Sticks oder einer SD-Karte.The transmission of the first and / or second firmware image to the device can also be done using an easily vulnerable data transmission channel, in particular using a remote maintenance or wireless interface or using a portable storage medium, such as a USB stick or SD card.

Das Gerät kann insbesondere ein Messgerät sein, welches einen Messwandler aufweist, welcher von einer Messgröße abhängige, insbesondere digitale, Messsignale erzeugt. In dieser Ausgestaltung kann die Geräteelektronik eine mit dem Messwandler zum Empfang der Messsignale, insbesondere lösbar oder nicht lösbar, verbundene Messelektronik umfassen, welche dazu ausgestaltet ist, die Messsignale zu verarbeiten und die verarbeiteten Messsignale an eine übergeordnete Einheit auszugeben.In particular, the device can be a measuring device which has a measuring transducer which generates measurement signals which depend on a measured variable, in particular digital signals. In this embodiment, the device electronics may comprise a measuring electronics connected to the measuring transducer for receiving the measuring signals, in particular detachably or non-detachably, which is designed to process the measuring signals and to output the processed measuring signals to a higher-order unit.

Die Erfindung wird im Folgenden im Detail anhand des in der Figur dargestellten Beispiels beschrieben.The invention will be described below in detail with reference to the example shown in the figure.

Die 1 zeigt eine Schemazeichnung eines Geräts der Mess- und Regeltechnik.The 1 shows a schematic drawing of a device of measurement and control technology.

Das in 1 schematisch dargestellte Gerät 1 ist ein Messgerät mit einem Messwandler 2 und einer Sensorelektronik 3. Die Sensorelektronik 3 umfasst einen A/D-Wandler 4, der die von dem Messwandler 2 erzeugten analogen Signale digitalisiert, einen Mikrocontroller 5, der die digitalisierten Messsignale empfängt und weiter verarbeitet, und eine Datenschnittstelle 6, über die der Mikrocontroller 5 die verarbeiteten Messsignale und/oder andere Informationen über Funk 7 oder über eine Leiterschleife 8 an eine übergeordnete Einheit 9, 10 ausgeben kann. Bei der übergeordneten Einheit 10 handelt es sich im vorliegenden Beispiel um einen tragbaren Computer, z.B. ein Smartphone. Die übergeordnete Einheit 9 kann beispielsweise eine Prozessleitstelle eines industriellen Prozesses sein. Das Gerät 1 weist außerdem eine Schnittstelle 11 zum Anschluss eines Speichermediums, z.B. einer SD-Karte 12, auf. Das Gerät 1 kann wahlweise mit der übergeordneten Einheit 9 und/oder der übergeordneten Einheit 10 verbunden werden. Um ein Firmware-Update durchzuführen, kann ein Firmware-Image, das den Programmcode der neuen Firmware enthält, von der Einheit 9 über die Leiterschleife 8 oder von der Einheit 10 über Funk 7 oder von der über die Schnittstelle 11 mit dem Gerät 1 verbundenen SD-Karte 12 an das Gerät 1, konkret über die Datenschnittstelle 6 an den Mikrocontroller 5, übertragen werden.This in 1 schematically illustrated device 1 is a measuring device with a transducer 2 and a sensor electronics 3 , The sensor electronics 3 includes an A / D converter 4 that of the transducer 2 generated analog signals digitized, a microcontroller 5 receiving and processing the digitized measurement signals, and a data interface 6 about which the microcontroller 5 the processed measuring signals and / or other information by radio 7 or via a conductor loop 8th to a higher-level unit 9 . 10 can spend. At the parent unit 10 In the present example this is a portable computer, eg a smartphone. The parent unit 9 may be, for example, a process control center of an industrial process. The device 1 also has an interface 11 for connecting a storage medium, eg an SD card 12 , on. The device 1 can optionally with the parent unit 9 and / or the parent unit 10 get connected. To perform a firmware update, a firmware image containing the program code of the new firmware may be removed from the unit 9 over the conductor loop 8th or from the unit 10 via radio 7 or from across the interface 11 with the device 1 connected SD card 12 to the device 1 , specifically via the data interface 6 to the microcontroller 5 , be transmitted.

Der Mikrocontroller 5 weist einen Flash-Speicher mit einer Firmware 13 auf, die mindestens zwei Firmware-Komponenten A, B umfasst. Die erste Komponente ist eine Applikations-Komponente, im Folgenden kurz als Applikation A bezeichnet. Die zweite Komponente ist eine Bootloader-Komponente, im Folgenden kurz als Bootloader B bezeichnet. Die Applikation A stellt Grundfunktionalitäten des Geräts 1 zur Verfügung. Der Bootloader B dient zur Aktualisierung der Applikation A in Form eines Firmware-Updates nach dem in der Einleitung beschriebenen Verfahren. Weiter besitzt das Gerät 1 einen persistenten Speicher 16, der im vorliegenden Beispiel als Teil des Mikrocontrollers 5 dargestellt ist. Im persistenten Speicher des Gerätes 16 befindet sich ein öffentlicher Schlüssel PK eines asymmetrischen Signaturverfahrens abgelegt.The microcontroller 5 has a flash memory with a firmware 13 which comprises at least two firmware components A, B. The first component is an application component, hereinafter referred to as application A for short. The second component is a bootloader component, hereinafter referred to as bootloader B for short. Application A represents basic functionalities of the device 1 to disposal. The boot loader B serves to update the application A in the form of a firmware update according to the method described in the introduction. Next has the device 1 a persistent store 16 in the present example as part of the microcontroller 5 is shown. In the persistent memory of the device 16 There is a public key PK filed an asymmetric signature procedure.

Die Firmware-Komponente A weist die folgenden Komponenten auf:

  • Eine Entropiequelle 17, beispielsweise einen Zufallszahlengenerator
  • Einen Algorithmus 18 zum, insbesondere segementweisen, Empfang eines neuen Firmware-Images
  • Einen Algorithmus 19 zur asymmetrischen Signaturprüfung
  • Einen Algorithmus 20 zur Generierung einer als Authentifizierungsinformation dienenden symmetrischen Prüfsumme MAC nach einem symmetrischen Kryptoverfahren, z.B. einen MAC-Algorithmus
  • – Eine Software-Komponente zur Ablage eines symmetrischen Schlüssels SK und einer generierten symmetrischen Prüfsumme MAC im persistenten Speicher 16
Firmware component A has the following components:
  • - An entropy source 17 , for example, a random number generator
  • - An algorithm 18 for, in particular segementweise, receiving a new firmware image
  • - An algorithm 19 for asymmetric signature verification
  • - An algorithm 20 for generating a symmetric checksum MAC serving as authentication information after one Symmetric crypto methods, eg a MAC algorithm
  • A software component for storing a symmetric key SK and a generated symmetric checksum MAC in the persistent memory 16

Die Firmware-Komponente B enthält dabei die folgenden Komponenten

  • Einen Algorithmus 21 zum Empfang eines neuen Firmware-Images
  • Einen Algorithmus 22 zum Auslesen des symmetrischen Schlüssels SK und MAC aus einem Speicher 16 und zur Errechnung und Prüfung einer symmetrischen Prüfsumme MAC der mit dem neuen Firmware-Image übermittelten neuen Firmware.
The firmware component B contains the following components
  • - An algorithm 21 to receive a new firmware image
  • - An algorithm 22 for reading the symmetric key SK and MAC from a memory 16 and to calculate and check a symmetric checksum MAC of the new firmware transmitted with the new firmware image.

Optional enthalten die Komponenten A und/oder B noch zusätzlich einen Algorithmus zur Entschlüsselung eines Firmware-Images bzw. eines in dem Firmware-Image enthaltenen Firmware-Programmcodes mit einem symmetrischen Schlüssel (nicht in 1 dargestellt). Diese Verschlüsselungskomponente dient jedoch lediglich zum Know-How-Schutz des Geräteherstellers der Automatisierungskomponente, und nicht in erster Linie zum Schutz eines Anlagenbetreibers vor einem Datensicherheitsangriff. Sie ist daher optional.Optionally, the components A and / or B additionally contain an algorithm for decoding a firmware image or a firmware program code contained in the firmware image with a symmetric key (not in FIG 1 shown). However, this encryption component only serves for the know-how protection of the device manufacturer of the automation component, and not primarily for the protection of a plant operator from a data security attack. It is therefore optional.

Das Verfahren zur Aktualisierung der Firmware 13, insbesondere der Applikation A, besteht darin, dass der authentische Gerätehersteller sich einen asymmetrischen Signaturalgorithmus auswählt und für diesen Algorithmus ein öffentliches/privates Schlüsselpaar erzeugt. Er stellt dabei mit ausreichender Sorgfalt sicher, dass nur berechtigte Personen, die für die Freigabe einer authentischen Software verantwortlich sind, Verfügungsgewalt über den privaten Schlüssel erlangen können. Der zugehörige öffentliche Schlüssel PK wird dann bekannt gemacht und unter anderem im Speicher 16 des ausgelieferten Gerätes 1 abgelegt, so dass dieser öffentliche Schlüssel PK für den Prozess des Firmware-Updates dort verfügbar ist.The procedure for updating the firmware 13 , in particular the application A, is that the authentic device manufacturer selects an asymmetric signature algorithm and generates a public / private key pair for this algorithm. He ensures with sufficient care that only authorized persons, who are responsible for the release of an authentic software, can gain control over the private key. The associated public key PK is then made known and among other things in the memory 16 of the delivered device 1 stored so that this public key PK for the process of firmware update is available there.

In der Firmware-Komponente A sind dann für das Firmware-Update die folgenden Verfahrensschritte implementiert:

  • 1. Zunächst wird mit dem Zufallszahlengenerator 17 eine unvorhersagbare Zufallszahlensequenz SK von vorzugsweise mindestens 80 Bits generiert und im Speicher persistiert. Diese Zufallszahlensequenz dient in einem weiteren Verfahrensschritt als symmetrischer Schlüssel SK für einen symmetrischen MAC-Algorithmus.
  • 2. Dann wird über das externe Dateninterface 6 ein erstes Mal die neue Firmware als Bestandteil eines Firmware-Images von einem externen Gerät, z.B. einer der übergeordneten Einheiten 9, 10 oder von der SC-Karte 12 übertragen. Die empfangenen Firmware-Daten werden dabei von dem Algorithmus 18 segmentweise empfangen und nur an die zwei unten beschriebenen Kryptographiealgorithmen weiter geleitet und anschließend verworfen und nicht weiter gespeichert. Dadurch muss der Mikrocontroller 5 keinen wesentlichen Speicherplatz für den Empfang und die Authentifizierung der neuen Firmware bereitstellen.
  • 3. Mit den eingegangenen Firmware-Daten wird parallel zur Übertragung der symmetrische MAC-Prüfsummenalgorithmus 20 durchgeführt. Dieser erhält neben den empfangenen zu prüfenden Firmware-Daten als Eingabegröße den soeben neu generierten Schlüssel SK aus dem Speicher 16. Zeitgleich erfolgt die asymmetrische Signaturprüfung durch den Algorithmus 19 unter Verwendung des im Speicher 16 abgelegten öffentlichen Schlüssels PK.
  • 4. Nach vollständig erfolgter Übertragung des neuen Firmware-Images liegt das Ergebnis der asymmetrischen Signaturprüfung vor. Ebenfalls liegt die auf Basis des gerade eben selbst generierten Schlüssels SK errechnete, einfach zu verifizierende symmetrische MAC-Prüfsumme MAC vor.
  • 5. Sofern die asymmetrische Signaturprüfung erfolgreich war, wird die zugehörige symmetrische MAC-Prüfsumme im Speicher 16 persistiert. Dort liegen also nun ein frisch generierter symmetrischer Schlüssel SK und der für diesen Schlüssel generierte symmetrische Prüfsumme MAC für die im Rahmen des asymmetrischen Verfahren als „authentisch“ erkannte neue Firmware. Besonders vorteilhaft ist dabei, dass der für die symmetrische Prüfsummenberechnung verwendete Schlüssel SK für einen Angreifer nicht vorhersagbar ist.
In firmware component A, the following method steps are then implemented for the firmware update:
  • 1. First, use the random number generator 17 generates an unpredictable random number sequence SK of preferably at least 80 bits and persists in memory. This random number sequence is used in a further method step as a symmetric key SK for a symmetric MAC algorithm.
  • 2. Then via the external data interface 6 a first time the new firmware as part of a firmware image from an external device, such as one of the higher-level units 9 . 10 or from the SC card 12 transfer. The received firmware data are thereby from the algorithm 18 received segment by segment and forwarded only to the two cryptographic algorithms described below and then discarded and not stored further. This requires the microcontroller 5 do not provide significant memory for receiving and authenticating the new firmware.
  • 3. With the received firmware data is parallel to the transmission of the symmetric MAC checksum algorithm 20 carried out. This receives in addition to the received firmware data to be tested as an input size just newly generated key SK from the memory 16 , At the same time, the asymmetric signature check is performed by the algorithm 19 using the in store 16 filed public key PK.
  • 4. After complete transfer of the new firmware image, the result of the asymmetric signature check is available. Also, based on the just self-generated key SK calculated, easy to verify symmetric MAC checksum MAC is present.
  • 5. If the asymmetric signature check was successful, the associated symmetric MAC checksum will be in memory 16 persists. There, a freshly generated symmetrical key SK and the symmetrical checksum MAC generated for this key are now located there for the new firmware recognized as "authentic" within the framework of the asymmetrical method. It is particularly advantageous that the key SK used for the symmetric checksum calculation is unpredictable for an attacker.

Im Anschluss wird dann nach den erfolgreich abgearbeiteten obigen Schritten die Kontrolle an den Bootloader B übergeben. Dort erfolgen dann die Schritte:

  • 1. Der Speicherbereich, in den die neue Firmware abgelegt werden soll, wird vorbereitet (gelöscht). Dieser Speicherbereich wurde vorher eventuell von der Applikation A zumindest teilweise beansprucht.
  • 2. Anschließend wird die neue Firmware als Bestandteil eines weiteren Firmware-Images ein zweites Mal von dem externen Gerät über die Datenschnittstelle 6 übertragen und jetzt während des Empfangs in dem vorbereiteten Speicherbereich persistiert. In diesem Schritt erfolgt auch die optionale Entschlüsselung des Firmware-Programmcodes (um den Firmware-Code vertraulich zu halten und Know-How z.B. des Geräteherstellers zu schützen).
  • 3. Parallel zu dieser zweiten Übertragung wird auf Basis des persistierten Schlüssels SK und des mit geringem Speicherbedarf implementierbaren symmetrischen MAC-Algorithmus 22 die symmetrische Prüfsumme errechnet.
  • 4. Nach Empfang des vollständigen Firmware-Images wird anschließend geprüft, dass die vom Bootloader B errechnete MAC-Prüfsumme mit der von der Applikation A entsprechend errechneten und im Speicher 16 abgelegten Prüfsumme MAC übereinstimmt. Übereinstimmung der MAC-Prüfsummen impliziert die Übereinstimmung des von dem Bootloader B bei der zweiten Übertragung empfangenen Firmware-Daten mit den zuvor bei der ersten Übertragung von der Applikation A empfangenen und mittels des Algorithmus 19 zur asymmetrischen Signaturprüfung authentifizierten Firmware-Daten. Liegt diese Übereinstimmung vor, ist gleichzeitig die Authentizität des an den Bootloader B bei der zweiten Übertragung übertragenen Firmware-Images bzw. der darin enthaltenen Firmware-Daten sichergestellt.
  • 5. Sofern die von den Firmware-Komponenten A und B errechneten symmetrischen Prüfsummen identisch sind, wird die neu empfangene und jetzt auch im Speicher persistierte Firmware aktiv geschaltet und ausgeführt. Anderenfalls wird erneut Schritt 1 aus dieser Aufführung ausgeführt und die offenbar nichtauthentische Firmware wieder gelöscht.
Afterwards the control will be handed over to the Bootloader B after the successful completion of the above steps. There are then the steps:
  • 1. The memory area in which the new firmware is to be stored is prepared (deleted). This memory area was previously possibly claimed by the application A at least partially.
  • 2. Subsequently, the new firmware, as part of another firmware image, is re-used a second time by the external device via the data interface 6 and persists during reception in the prepared memory area. This step also includes the optional decryption of the firmware program code (to keep the firmware code confidential and to protect the know-how of the device manufacturer, for example).
  • 3. Parallel to this second transmission is based on the persisted key SK and the symmetric MAC algorithm that can be implemented with low storage requirements 22 calculates the symmetric checksum.
  • 4. After receiving the complete firmware image, it is then checked that the MAC checksum calculated by Bootloader B is calculated in memory with that calculated by Application A and stored in memory 16 stored checksum MAC matches. Correspondence of the MAC checksums implies that the firmware data received from the boot loader B during the second transmission matches the one previously received at the first transmission from the application A and by means of the algorithm 19 for asymmetric signature verification authenticated firmware data. If this match exists, the authenticity of the firmware image transferred to the bootloader B during the second transfer or the firmware data contained therein is ensured at the same time.
  • 5. If the symmetrical checksums calculated by the firmware components A and B are identical, the newly received firmware, which has now also been stored in the memory, will be activated and executed. Otherwise, step 1 will be executed again from this performance and the apparent nonauthentic firmware will be deleted.

Beachtlich ist, dass im Fall der als Option beschriebenen Kombination von Firmware-Signatur (Authentizität) und Firmware-Verschlüsselung (Vertraulichkeit) die Reihenfolge von Signatur-Errechnung und Verschlüsselung austauschbar sind und für das hier beschriebene Verfahren die Reihenfolge nicht relevant ist. Vorzugsweise wird empfohlen, die Firmware zunächst zu verschlüsseln und die Signatur über die verschlüsselte Firmware zu errechnen.It is noteworthy that in the case of the combination of firmware signature (authenticity) and firmware encryption (confidentiality) described as an option, the sequence of signature calculation and encryption are interchangeable and the order for the method described here is irrelevant. Preferably, it is recommended to first encrypt the firmware and calculate the signature via the encrypted firmware.

Im konkreten Ausführungsbeispiel besteht das in dem Gerät 1 enthaltene System, an das eine neue Firmware übertragen werden soll, aus einem Mikrocontroller 5 mit 64 kByte Flash-Speicher. Dieser Speicher wird aufgeteilt in 59k Applikations-Programm (Komponente A), 1 kByte Datensektion z.B. für kryptographische Schlüssel und MAC-Codes (Speicher 16) und 4 kByte Bootloader (Komponente B). In vielen Fällen ist der Speicher des Mikrocontrollers direkt integriert, bei manchen Systemen wird der Speicher des Mikrocontrollers über einen externen Speicherchip außerhalb des Gehäuses der CPU angebunden.In the concrete embodiment, this is in the device 1 contained system to which a new firmware is to be transferred from a microcontroller 5 with 64 kbytes of flash memory. This memory is divided into 59k application program (component A), 1 kByte data section eg for cryptographic keys and MAC codes (memory 16 ) and 4 kByte bootloader (component B). In many cases, the memory of the microcontroller is directly integrated, in some systems the memory of the microcontroller is connected via an external memory chip outside the case of the CPU.

Kandidaten für diesen Mikrocontroller wären z.B. 8-Bit CPUs der Hersteller Atmel aus der Serie AVR oder ARM-basierte Mikrocontroller der Hersteller Texas Instruments, NXP oder ST-Microelectronics mit vergleichbarem Speicherausbau. Diese Systeme verfügen typisch über 8 bis 16 kByte RAM-Speicher.Candidates for this microcontroller would be e.g. 8-bit Atmel CPUs from the AVR series or ARM-based microcontrollers from Texas Instruments, NXP or ST-Microelectronics with comparable memory configuration. These systems typically have 8 to 16 KB of RAM.

Der Bootloader B integriert dabei neben den Routinen für den Empfang der Firmware über ein serielles SPI oder UART-Interface Routinen zum partiellen Löschen des Flashs.In addition to the routines for receiving the firmware via a serial SPI or UART interface, the bootloader B also integrates routines for partial deletion of the flash.

Die Daten für das Firmware-Update werden über ein geeignetes Interface so ins Gerät 1 übertragen, dass das Teilsystem, welches ein Firmware-Update erhalten soll, diese Daten über das serielle Interface übermittelt werden können. Diese Übertragung kann z.B. funkbasiert über Bluetooth oder WLAN übers Internet über einen Fernwartungszugang oder über ein Feldbus-Interface erfolgen. In diesem Fall kann ein Angreifer, der zumindest partiell Kontrolle über den Datenkanal erhält, dem Feldgerät ein nicht authentisches Firmware-Image übermitteln.The data for the firmware update are sent to the device via a suitable interface 1 transmit that the subsystem, which is to receive a firmware update, this data can be transmitted via the serial interface. This transmission can take place, for example, radio-based via Bluetooth or WLAN via the Internet via a remote maintenance access or via a fieldbus interface. In this case, an attacker who at least partially receives control over the data channel can transmit a non-authentic firmware image to the field device.

Beachtlich ist, dass insbesondere im Fall von Funk oder Internetverbindungen, die Übermittlung der Firmware-Daten vollkommen unbeobachtet manipuliert werden könnte und in diesem Fall die Authentizitätsprüfung der Firmware über eine asymmetrische Firmware-Signatur ggf. besonders wichtig wird.It is noteworthy that, especially in the case of radio or Internet connections, the transmission of firmware data could be manipulated completely unobserved and in this case the authenticity check of the firmware via an asymmetric firmware signature may be particularly important.

Alternativ ist möglich, die Daten über ein transportables Speichermedium, wie z.B. SD-Karten oder USB-Sticks zu übermitteln. Auch hier hat ein Angreifer mit zumindest temporärem Zugang zum Messgerät die Möglichkeit, zu versuchen, ein nichtauthentisches Firmware-Image zu übermitteln.Alternatively, it is possible to transfer the data via a portable storage medium, such as e.g. SD cards or USB sticks to submit. Again, an attacker with at least temporary access to the meter has the opportunity to try to transmit a nonauthentic firmware image.

Es ist ggf. vorteilhaft, die Daten der neuen Firmware in einem ggf. verfügbaren „größeren“ Mikroprozessorsystem des gleichen Messgeräts temporär lokal abzulegen (zu cachen), bevor sie dem kleinen Mikrocontroller über das serielle Interface übermittelt werden. In diesem Fall besteht vom Mikrocontroller eine serielle Datenverbindung zum „größeren“ Partner-Controller, der das ggf. gecachte Firmware-Image weiterreicht.It may be advantageous to temporarily cache (cache) the data of the new firmware in an optionally available "larger" microprocessor system of the same meter before transmitting it to the small microcontroller via the serial interface. In this case, the microcontroller has a serial data connection to the "larger" partner controller, which passes on the possibly cached firmware image.

Der Bootloader B implementiert einen symmetrischen MAC-Algorithmus (Algorithmus 22) zur Prüfsummenerrechnung. Als konkretes Ausführungsbeispiel wird die Implementierung des Algorithmus Chaskey-LTS vorgeschlagen, alternativ die Verwendung eines MAC-Verfahrens auf Basis des Algorithmus AES128-CBC, für den Fall dass z.B. im Mikrocontroller eine Hardware-Beschleunigereinheit für AES128 zur Verfügung stehen sollte oder anderer Prüfsummenverfahren, wie z.B. aus der Siphash-Familie. Diese Algorithmen lassen sich mit einem RAM-Bedarf in der Größenordnung von 64 Bytes und einem Flash-Bedarf in der Größenordnung von 512 Bytes implementieren und sind damit kompatibel mit dem Gesamt-Speicherbudget des Bootloaders B von 4 kByte.Bootloader B implements a symmetric MAC algorithm (Algorithm 22 ) for checksum calculation. As a concrete embodiment, the implementation of the algorithm Chaskey-LTS is proposed, alternatively, the use of a MAC method based on the algorithm AES128-CBC, for example, if in the microcontroller, a hardware accelerator unit for AES128 should be available or other checksum method, such as eg from the siphash family. These algorithms can be implemented with a RAM requirement of the order of 64 bytes and a flash requirement of the order of 512 bytes and are thus compatible with the total memory budget of bootloader B of 4 Kbytes.

Die Applikation A implementiert den gleichen symmetrischen MAC-Algorithmus (Algorithmus 20) und zusätzlich ein asymmetrisches Verfahren zur Signaturprüfung (Algorithmus 19). Für die dort während des Firmware-Updates verwendete zusätzliche asymmetrische Signaturprüfung wird dort z.B. ein Verfahren auf Basis von Elliptischen Kurven eingesetzt. Z.B. der Algorithmus EdDSA auf der elliptischen Kurve Curve25519. Die Nutzung der Kurve Curve25519 und EdDSA ermöglicht dabei eine besonders Code- und ressourcensparende Implementierung der Signaturprüfung.Application A implements the same symmetric MAC algorithm (Algorithm 20 ) and in addition an asymmetric method for signature verification (algorithm 19 ). For the additional asymmetric signature check used there during the firmware update, for example, a method based on elliptic curves is used there. Eg the algorithm EdDSA on the elliptic curve Curve25519. The use of the curve Curve25519 and EdDSA enables a particularly code- and resource-saving implementation of the signature check.

Alternativ zu EdDSA auf Edwards-Kurven sind ebenso sogenannte Koblitz-Kurven auf Galois-Körpern oder sogenannte „Short-Weierstrass“ Kurven aus den Standards des NIST, der SECP-Gruppe oder der sogenannten Brainpool-Arbeitsgruppen verwendbar, für die unter dem Namen ECDSA asymmetrische Signaturverfahren standardisiert sind (siehe z.B. Standard ANS X9.62, http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf ). Der EdDSA Algorithmus verwendet neben einer sogenannten Skalarmultiplikation auf der elliptischen Kurve einen kryptographisch sicheren, kollisionsresistenten HASH-Algorithmus, z.B. SHA512 oder SHA-3. Der Signaturprüfungsalgorithmus EdDSA auf Curve25519 (inklusive SHA512) erfordert einen Speicherbedarf von ca. 15 kByte ROM und ca. 512 Bytes RAM und ist kann damit im Speicherbudget der Applikationsfirmware A implementiert werden.As an alternative to EdDSA on Edwards curves, so-called Koblitz curves on Galois bodies or so-called "Short-Weierstrass" curves from the standards of NIST, the SECP group or the so-called Brainpool working groups can be used, for which under the name ECDSA asymmetric Signature procedures are standardized (see, eg Standard ANS X9.62, http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf ). The EdDSA algorithm uses a so-called scalar multiplication on the elliptic curve, a cryptographically secure, collision-resistant HASH algorithm, eg SHA512 or SHA-3. The signature verification algorithm EdDSA on Curve25519 (including SHA512) requires a memory requirement of approx. 15 kbytes of ROM and approx. 512 bytes of RAM and can thus be implemented in the memory budget of the application firmware A.

Alternativ sind für die Applikation A auch Implementierungen asymmetrischer Signaturen auf Basis von Primzahlkörpern möglich, z.B. RSA- oder DSA-Basierte Signaturen. Im Vergleich mit Signaturalgorithmen auf Basis elliptischer Kurven (ECDSA, EdDSA) besteht der Vorteil letzterer darin, dass die Signaturfelder deutlich kürzer sind als bei RSA- oder DSA-Algorithmen und im Vergleich mit RSA-basierten Signaturen nur unwesentlich langsamer und mit geringerem Speicherbedarf an RAM errechnet werden können.Alternatively, implementations of asymmetric signatures based on prime number fields are possible for application A, e.g. RSA or DSA-based signatures. In comparison with signature algorithms based on elliptic curves (ECDSA, EdDSA), the advantage of the latter is that the signature fields are significantly shorter than in RSA or DSA algorithms and, compared to RSA-based signatures, only marginally slower and with a smaller memory requirement of RAM can be calculated.

Der für die Signaturprüfung erforderliche öffentliche Schlüssel PK ist vorzugsweise in jedes ausgelieferte Firmware-Image fest eincompiliert. Er könnte jedoch auch unabhängig vom Firmware-Image in einen definierten Speicherbereich des Mikrocontrollers abgelegt werden, z.B. in dem erwähnten 1 kByte-Bereich (Speicher 16) welcher für Daten reserviert ist.The public key PK required for the signature check is preferably compiled into each delivered firmware image. However, it could also be stored independently of the firmware image in a defined memory area of the microcontroller, for example in the mentioned 1 kbyte area (memory 16 ) which is reserved for data.

Die Zufallszahlengenerierung zur Erzeugung eines für jedes Firmware-Update frisch generierten geräteindividuellen Schlüssels SK erfolgt auf Basis der bekannten Verfahren für kryptographisch sichere Zufallszahlengenerierung. Insbesondere wird im Ausführungsbeispiel der Zufallszahlengenerator unter anderem durch einen während der Gerätefertigung einmalig übermittelten sogenannten Seed-Wert parametriert, sowie zusätzlich durch im Gerät verfügbare Entropiequellen, wie rauschbehaftete Messwerte, unvorhersagbare Zeitstempel und ggf. Hardware-Zufallszahlengeneratoren.The random number generation for generating a for each firmware update freshly generated device-specific key SK is based on the known methods for cryptographically secure random number generation. In particular, in the exemplary embodiment, the random number generator is parameterized, inter alia, by a so-called seed value transmitted once during device production, and additionally by entropy sources available in the device, such as noisy measurement values, unpredictable time stamps and possibly hardware random number generators.

Beispielsweise wird vorgeschlagen, die Zufallszahlen dadurch zu generieren, dass zunächst die verschiedenen Entropiequellen, wie initiales geräteindividuelles Factory-Randomseed FRS (in der Gerätefertigung initial vom Prüfplatz des Herstellers errechnet und im Flash abgelegt), Boot-Zähler BC, rauschbehaftete ADC-Werte ADCNOISE, etc. mittels eines sogenannten kryptographischen Hash-Algorithmus wie SHA512 zu einer Zahl RS = SHA512(FRS || BC || ADCNOISE) zusammengemischt werden. Das Ergebnis RS kann dann selbst als Zufallszahl verwendet werden, oder als Schlüssel für eine sogenannten Stream-Cipher-Algorithmus, wie AES128-CTR, Salsa20, Chacha20 genutzt werden, der dann für die Generierung der Zufallszahlen genutzt wird. Dieses Vorgehen stellt sicher, dass ein potentieller Angreifer den genauen Wert des im Zuge des Firmware-Updates verwendeten Schlüssels SK nicht vorhersagen kann und damit auch keine Möglichkeit hat, ein Firmware-Image mit manipulierten Daten zu generieren das bei der oben beschriebenen zweiten Übertragung über die externe Datenschnittstelle an den Bootloader B fälschlich als authentisch erkannt wird.For example, it is proposed to generate the random numbers by first determining the various sources of entropy, such as initial device-specific factory randomization FRS (initially calculated by the testing station of the manufacturer and stored in flash), boot counter BC, noisy ADC values ADCNOISE, etc. by means of a so-called cryptographic hashing algorithm such as SHA512 to a number RS = SHA512 (FRS || BC || ADCNOISE). The result RS can itself be used as a random number, or used as a key for a so-called stream cipher algorithm, such as AES128-CTR, Salsa20, Chacha20, which is then used to generate the random numbers. This procedure ensures that a potential attacker can not predict the exact value of the key SK used in the course of the firmware update and thus has no possibility to generate a firmware image with manipulated data that in the above described second transmission over the external data interface to the bootloader B is incorrectly recognized as authentic.

Für eine neu zu übertragende Firmware zur Aktualisierung der Firmware des Systems im Gerät 1 wird mit Hilfe des privaten Schlüssels ein Signaturfeld generiert. Dieser Schlüssel ist nur beim Gerätehersteller ausgewählten Personenkreisen verfügbar. An den Programmcode und ggf. zugehörigen konstanten Datenbereiche der Firmware wird anschließend die daraus errechnete EdDSA-Signatur AS angehängt. Mit dem Begriff Firmware-Image wird hier eine geeignete Kombination von Datenbereich (Firmware-Programmcode + konstante Daten) und einem optional vorhandenen Signaturfeld AS bezeichnet. Die im Datenbereich enthaltenen Daten werden auch als Firmware oder als Firmware-Daten bezeichnet. Im Stand der Technik sind verschiedene sogenannte Container-Formate bekannt, um an einen Datenblock ein Signatur-Feld anzuhängen, z.B. unter dem ITU-T Standard X.509 , wie er für Internet-Zertifikate verwendet wird. Für solche Container-Formate gibt es z.B. fertige Standard-Programme zur Überprüfung des Signaturfelds. Für den hier beschriebenen Fall reicht es aber beispielsweise auch vollkommen aus, das Firmware-Image dadurch zu generieren, dass dem Datenbereich eine Längenangabe vorangestellt und an den Datenbereich das Signaturfeld angehängt wird.For a new firmware to be transferred to update the firmware of the system in the device 1 A signature field is generated using the private key. This key is only available to selected device groups at the device manufacturer. The resulting EdDSA signature AS is then appended to the program code and, if appropriate, associated constant data areas of the firmware. The term firmware image here denotes a suitable combination of data area (firmware program code + constant data) and an optionally existing signature field AS. The data contained in the data area is also called firmware or firmware data. In the prior art, various so-called container formats are known to attach to a data block a signature field, for example, under the ITU-T Standard X.509 as used for internet certificates. For such container formats, there are, for example, ready-made standard programs for checking the signature field. For the case described here, however, it is also completely sufficient, for example, to generate the firmware image by prefixing the data area with a length specification and appending the signature field to the data area.

Für das Firmware-Update wird von der Applikation A im Mikrocontroller 5 ein frischer Schlüssel SK ermittelt. Anschließend wird das Firmware-Image dem asymmetrischen Signaturprüfungsalgorithmus 19 zugeführt und parallel auch dem symmetrischen MAC-Algorithmus 20 (z.B. Chaskey-LTS). Letzterer verwendet für die Prüfsummenerrechnung den symmetrischen Schlüssel SK, der anhand des Zufallszahlengenerators frisch erzeugt wurde und im Speicher 16 persistiert wird. Dabei ist der Aspekt wichtig, dass es weder für die Signaturprüfung noch für das symmetrische Prüfsummenverfahren erforderlich ist, dass das Firmware-Image zu einem gegebenen Zeitpunkt in Gänze im RAM-Speicher des Mikrocontrollers verfügbar ist. Es reicht vielmehr aus, die Daten des Firmware-Images segmentweise nach und nach zu verarbeiten, beispielsweise in Blöcken von 16 oder 128 Bytes. Es wird dabei jeweils nacheinander ein solches Teilsegment für die Prüfsummenverfahren herangezogen und anschließend im Speicher ggf. vom darauf folgenden Datensegment überschrieben. In der Fachsprache spricht man hierbei häufig davon, dass die beiden Kryptographie-Verfahren über ein speichersparendes sogenanntes „streaming“-Applikations-Interface implementiert werden können, bei dem die Daten in Form eines sequentiellen „Stroms“ von kleineren Teilsegmenten übermittelt werden. For the firmware update is from the application A in the microcontroller 5 a fresh key SK is detected. Subsequently, the firmware image becomes the asymmetric signature verification algorithm 19 fed in parallel to the symmetric MAC algorithm 20 (eg Chaskey-LTS). The latter uses for the checksum calculation the symmetric key SK, which was freshly generated from the random number generator and in memory 16 is persisted. It is important to note that neither the signature check nor the symmetric checksum method requires that the firmware image be available at all times in the RAM memory of the microcontroller at any given time. Rather, it is sufficient to process the data of the firmware image segment by segment, for example in blocks of 16 or 128 bytes. In each case one such sub-segment is used in turn for the checksum method and then overwritten in memory, if necessary, by the subsequent data segment. In technical terminology, this often refers to the fact that the two cryptography methods can be implemented via a memory-saving so-called "streaming" application interface in which the data is transmitted in the form of a sequential "stream" of smaller sub-segments.

Im Zuge der Übermittlung des vollständigen Firmware-Images empfängt die Applikation A auch das an das Firmware-Image angehängte generierte Signaturfeld AS über das serielle Interface. Dieser von extern empfangene Wert AS wird mittels des EdDSA-Algorithmus 19 unter Zuhilfenahme des verfügbaren öffentlichen Schlüssels des Geräteherstellers auf Authentizität überprüft.During the transmission of the complete firmware image, the application A also receives the generated signature field AS attached to the firmware image via the serial interface. This externally received value AS is determined by the EdDSA algorithm 19 checked for authenticity using the available public key of the device manufacturer.

Sofern die Signaturprüfung erfolgreich verlaufen sein sollte, wird der mit dem symmetrischen Schlüssel SK errechnete symmetrische Prüfsummenwert MAC für die Daten des gerade empfangenen Firmware-Images im Flash-Speicher 16 abgelegt und die Kontrolle der CPU an die Bootloader-Firmware B abgegeben.If the signature check was successful, the symmetric checksum value MAC calculated with the symmetric key SK becomes the data of the currently received firmware image in the flash memory 16 filed and the control of the CPU to the boot loader firmware B delivered.

Diese löscht anschließend den vormals von der Applikation A belegten Speicherbereich im Flash. Sie findet im Speicher 16 den für den symmetrischen Algorithmus 22 (z.B. Chaskey) zu verwendenden Schlüssel SK und das richtige Ergebnis der Prüfsumme MAC vor, das die Firmware-Komponente A gerade eben errechnet hat. Diese Prüfsumme MAC ist für niemanden vorhersagbar, auch nicht für den Gerätehersteller, da in diesen Wert der unvorhersagbare Schlüssel SK mit eingeht.This then deletes the memory area previously occupied by application A in Flash. She finds in the store 16 the one for the symmetric algorithm 22 (eg Chaskey) to use key SK and the correct result of the checksum MAC before, which has just calculated the firmware component A just. This checksum MAC is unpredictable for anyone, not even for the device manufacturer, since in this value the unpredictable key SK is included.

Anschließend fordert der Bootloader B erneut die Übertragung der kompletten Firmware-Daten an, empfängt ein daraufhin übertragenes zweites, die Firmware-Daten enthaltendes Firmware-Image, führt mit den empfangenen Firmware-Daten die symmetrische Prüfsummenberechnung durch und verifiziert die Korrektheit des erneut übertragenen Firmware-Images anhand der erforderlichen Übereinstimmung mit dem entsprechenden Ergebnis der alten Applikation A (die jetzt im Flash nicht mehr verfügbar ist). Während dieser zweiten Übertragung erfolgt also die symmetrische Prüfsummenberechnung und die Ablage der Daten im vorbereiteten gelöschten Flashbereich.The bootloader B then again requests the transmission of the complete firmware data, receives a subsequently transmitted second firmware image containing the firmware data, carries out the symmetrical checksum calculation with the received firmware data and verifies the correctness of the retransmitted firmware. Images based on the required match with the corresponding result of the old application A (which is now no longer available in Flash). During this second transmission, therefore, the symmetrical checksum calculation and the storage of the data in the prepared deleted flash area takes place.

Nach vollständiger erneuter Übertragung des neuen Firmware-Images erfolgt die Überprüfung der symmetrischen Prüfsumme. Sofern das Ergebnis mit dem von der alten Applikation A errechneten Prüfsumme übereinstimmt, wird auf Authentizität erkannt und die neue Firmware als gültig gewertet und aktiv geschaltet. Sie ersetzt somit die zuvor gelöschte, alte Applikation A. Anschließend übergibt der Bootloader die Kontrolle an die neue Applikation und löscht den Speicherbereich des Speichers 16, in dem beim letzten Update die Schlüssel SK und die symmetrische Prüfsumme abgelegt waren.Once the new firmware image has been completely retransmitted, the symmetric checksum is checked. If the result matches the checksum calculated by the old application A, authenticity is detected and the new firmware is validated and switched to active. It thus replaces the previously deleted, old application A. Subsequently, the bootloader transfers the control to the new application and deletes the memory area of the memory 16 , in which the keys SK and the symmetric checksum were stored during the last update.

Der Vorteil dieses Verfahrens besteht darin, dass nun auch unter der Rahmenbedingung eines begrenzten Speicherbudgets einer Bootloader-Firmware eine verlässliche und robuste asymmetrische Signaturprüfung erfolgreich umgesetzt werden kann.The advantage of this method is that even under the constraints of a limited memory budget of a bootloader firmware, a reliable and robust asymmetric signature verification can now be successfully implemented.

Der Fachmann wird neben der oben beschriebenen Variante ohne Verschlüsselung der Firmware auch Varianten betrachten, bei denen nicht nur eine Firmware-Authentizitätsprüfung erfolgt, sondern auch die Firmware selbst verschlüsselt wird. Dazu wird zusätzlich zum öffentlichen Schlüssel des Geräteherstellers aus dem Signaturalgorithmus auch noch ein (geheim zu haltender) symmetrischer Schlüssel für die Firmware-Entschlüsselung abgelegt. Die Signaturprüfung erfolgt vorzugsweise für die verschlüsselte Firmware, kann jedoch auch für die entschlüsselte Firmware in anderer Reihenfolge durchgeführt werden.In addition to the above-described variant without encryption of the firmware, the person skilled in the art will also consider variants in which not only a firmware authenticity check takes place, but also the firmware itself is encrypted. For this purpose, in addition to the public key of the device manufacturer, the signature algorithm also stores a (secret) symmetric key for the firmware decryption. The signature check is preferably carried out for the encrypted firmware, but can also be performed for the decrypted firmware in a different order.

Beachtlich ist, dass nach Durchführung des Verfahrensschritts 1.) in der Bootloader-Komponente B ein Firmware-Update nur noch mit exakt der gleichen Firmware möglich ist, die zuvor in der Applikation als korrekt verifiziert wurde. Vorteilhafterweise wird deswegen zusammen mit dem Schlüssel SK und der von der Applikation errechneten symmetrischen MAC-Prüfsumme auch eine Firmware-Kennung im Flash-Speicher abgelegt, welche die zu übertragende Firmware-Daten eindeutig identifiziert, z.B. eine Firmware-Versionsnummer. Mittels dieser Firmware-Versionsnummer kann so z.B. die Bootloader-Software der übertragenden Gegenstelle über das Dateninterface 6 mitteilen, exakt welche Firmware-Version jetzt erwartet wird. Dies kann z.B. dann relevant sein, wenn ein Firmware-Update abgebrochen wurde (z.B. wegen eines Stromausfalls) und zu einem späteren Zeitpunkt wieder aufgenommen werden soll.It is noteworthy that after performing the process step 1.) in the bootloader component B, a firmware update is possible only with exactly the same firmware that was previously verified in the application as correct. Advantageously, therefore, together with the key SK and the symmetrical MAC checksum calculated by the application, a firmware identifier is also stored in the flash memory, which uniquely identifies the firmware data to be transmitted, for example a firmware version number. By means of this firmware version number, for example, the bootloader software of the transmitting remote station can be transmitted via the data interface 6 tell you exactly what firmware version is expected now. This may be relevant, for example if a firmware update has been aborted (eg because of a power failure) and should be resumed at a later date.

Zusammenfassend wird mit der Erfindung die Möglichkeit eröffnet, sichere asymmetrische Signaturen für die Absicherung von Firmware-Updates auch in kleinsten Microcontroller-Systemen mit begrenztem Speicherbudget durchzuführen.In summary, the invention opens up the possibility of performing secure asymmetric signatures for securing firmware updates even in the smallest microcontroller systems with a limited storage budget.

Dieser Vorteil wird im Wesentlichen nur durch den Nachteil erkauft, dass die Firmware nicht nur einmalig, sondern zweimalig übertragen werden muss und im ersten Schritt die Signaturprüfung erfolgt und die Ablage des Image und das Überschreiben des bisherigen Speichers erst im nachfolgenden Schritt.This advantage is essentially only paid for by the disadvantage that the firmware must be transferred not only once, but twice, and in the first step, the signature verification takes place and the storage of the image and the overwriting of the previous memory only in the subsequent step.

ZITATE ENTHALTEN IN DER BESCHREIBUNG QUOTES INCLUDE IN THE DESCRIPTION

Diese Liste der vom Anmelder aufgeführten Dokumente wurde automatisiert erzeugt und ist ausschließlich zur besseren Information des Lesers aufgenommen. Die Liste ist nicht Bestandteil der deutschen Patent- bzw. Gebrauchsmusteranmeldung. Das DPMA übernimmt keinerlei Haftung für etwaige Fehler oder Auslassungen.This list of the documents listed by the applicant has been generated automatically and is included solely for the better information of the reader. The list is not part of the German patent or utility model application. The DPMA assumes no liability for any errors or omissions.

Zitierte Nicht-PatentliteraturCited non-patent literature

  • Des. Codes Cryptogr. (2015) 77:493–514 [0021] Of. Codes Cryptogr. (2015) 77: 493-514 [0021]
  • Standard ANS X9.62, http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf [0075] Standard ANS X9.62, http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf [0075]
  • ITU-T Standard X.509 [0080] ITU-T standard X.509 [0080]

Claims (15)

Verfahren zum Aktualisieren einer die Funktionalität eines Geräts der Mess- und Regeltechnik bereitstellenden ersten Firmware-Komponente, welche in einen Mikrocontroller des Geräts eingebettet ist, umfassend: – Segmentweises Empfangen eines ersten Firmware-Images über ein mit einem externen Gerät verbundenes Dateninterface des Mikrocontrollers, wobei das erste Firmware-Image einen Datenbereich und ein Signaturfeld umfasst, und wobei der Datenbereich zur Aktualisierung der ersten Firmware-Komponente dienende, einen Firmware-Programmcode umfassende Daten enthält und das Signaturfeld eine nach einem ersten Kryptoverfahren erzeugte erste Authentifizierungsinformation enthält; – Durchführen einer Authentifizierung des ersten Firmware-Images anhand der ersten Authentifizierungsinformation mittels eines von der ersten Firmware-Komponente umfassten Authentifizierungs-Algorithmus nach dem ersten Kryptoverfahren; – Erzeugen einer zweiten Authentifizierungsinformation für die im Datenbereich des ersten Firmware-Images enthaltenen Daten mittels eines von der ersten Firmware-Komponente umfassten Algorithmus zur Erzeugung der zweiten Authentifizierungsinformation nach einem von dem ersten Kryptoverfahren verschiedenen, zweiten Kryptoverfahren; – nach erfolgreicher Authentifizierung des ersten Firmware-Images Speichern der zweiten Authentifizierungsinformation in einem persistenten Speicher des Geräts; – Löschen der ersten Firmware-Komponente, wobei das Löschen durch eine in den Mikrocontroller eingebettete zweite Firmware-Komponente gesteuert wird; – erneute Übertragung der zur Aktualisierung der ersten Firmware-Komponente dienenden Daten als Bestandteil eines zweiten Firmware-Images unter Beteiligung der zweiten Firmware-Komponente über das Dateninterface an den Mikrocontroller und Speichern der Daten im persistenten Speicher des Mikrocontrollers; – Durchführen einer Authentifizierung des bei der erneuten Übertragung empfangenen zweiten Firmware-Images anhand der in dem Mikrocontroller gespeicherten zweiten Authentifizierungsinformation mittels eines von der zweiten Firmware-Komponente umfassten Authentifizierungs-Algorithmus nach dem zweiten Kryptoverfahren, und – für den Fall einer erfolgreichen Authentifizierung des zweiten Firmware-Images Aktivschalten und Ausführen des mit dem zweiten Firmware-Image übertragenen und gespeicherten Firmware-Programmcodes als neue erste Firmware-Komponente.Method for updating a first firmware component which provides the functionality of a device of the measurement and control technology and which is embedded in a microcontroller of the device, comprising: Receiving a first firmware image segment by segment via a data interface of the microcontroller connected to an external device, wherein the first firmware image comprises a data area and a signature field, and wherein the data area is for updating the first firmware component comprising a firmware program code Contains data and the signature field contains a first authentication information generated after a first crypto procedure; Performing authentication of the first firmware image based on the first authentication information using an authentication algorithm included in the first firmware component after the first crypto-method; Generating second authentication information for the data contained in the data area of the first firmware image by means of an algorithm comprised by the first firmware component for generating the second authentication information according to a second crypto method different from the first crypto method; After successful authentication of the first firmware image, storing the second authentication information in a persistent memory of the device; Deleting the first firmware component, wherein the deletion is controlled by a second firmware component embedded in the microcontroller; Retransmission of the data used to update the first firmware component as part of a second firmware image involving the second firmware component via the data interface to the microcontroller and storing the data in the persistent memory of the microcontroller; Performing an authentication of the second firmware image received during retransmission based on the second authentication information stored in the microcontroller by means of an authentication algorithm included in the second firmware component according to the second crypto method, and - in the case of a successful authentication of the second firmware image, activating and executing the firmware program code transmitted and stored with the second firmware image as the new first firmware component. Verfahren nach Anspruch 1, weiter umfassend: für den Fall einer nicht erfolgreichen Authentifizierung des zweiten Firmware-Images, Löschen der mit dem zweiten Firmware-Image übertragenen und gespeicherten Daten, insbesondere des gespeicherten Firmware-Programmcodes.Method according to claim 1, further comprising: in the case of an unsuccessful authentication of the second firmware image, deleting the data transmitted and stored with the second firmware image, in particular the stored firmware program code. Verfahren nach Anspruch 1 oder 2, wobei das erste Kryptoverfahren ein asymmetrisches Kryptoverfahren ist, beispielsweise ein Verfahren auf Basis von Elliptischen Kurven, insbesondere auf Basis des EdDSA-Algorithmus auf der elliptischen Kurve Curve25519, eines Verfahrens der ECDSA-Standardfamilie oder ein Verfahren auf der Basis von Primzahlkörpern, insbesondere ein RSA- oder DSA-Verfahren.Method according to claim 1 or 2, wherein the first crypto-method is an asymmetric crypto-method, For example, a method based on elliptic curves, in particular based on the EdDSA algorithm on the elliptic curve Curve25519, a method of the ECDSA standard family or a method based on prime number bodies, in particular an RSA or DSA method. Verfahren nach Anspruch 3, wobei das zweite Kryptoverfahren ein symmetrisches Kryptoverfahren ist, beispielsweise ein MAC-Verfahren auf Basis eines Blockverschlüsselungsalgorithmus, insbesondere ein Verfahren auf Basis der Algorithmenfamilie Chaskey oder AES128-CBC.Method according to claim 3, the second crypto method being a symmetric crypto method, For example, a MAC method based on a block encryption algorithm, in particular a method based on the algorithm family Chaskey or AES128-CBC. Verfahren nach Anspruch 4, wobei das symmetrische Kryptoverfahren keinen kollisionsresistenten Hash-Algorithmus als Teilkomponente umfasst.The method of claim 4, wherein the symmetric cryptographic method does not include a collision-resistant hash algorithm as a subcomponent. Verfahren nach einem der Ansprüche 3 bis 5, wobei die erste Authentifizierungsinformation eine mit einem privaten Schlüssel unter Verwendung der in dem Datenbereich enthaltenen Daten, insbesondere des Firmware-Programmcodes, erzeugte digitale Signatur ist; und wobei das Durchführen der Authentifizierung des ersten Firmware-Images eine Überprüfung der digitalen Signatur mittels eines in einem persistenten Speicher des Mikrocontrollers gespeicherten öffentlichen Schlüssels umfasst.Method according to one of claims 3 to 5, wherein the first authentication information is a digital signature generated with a private key using the data contained in the data area, in particular the firmware program code; and wherein performing the authentication of the first firmware image comprises verifying the digital signature using a public key stored in a persistent memory of the microcontroller. Verfahren nach einem der Ansprüche 4 bis 6, wobei das Erzeugen der zweiten Authentifizierungsinformation umfasst: Erzeugen einer als zweite Authentifizierungsinformation dienenden Prüfsumme nach dem zweiten Kryptoverfahren aus einem mittels eines von der ersten Firmware-Komponente umfassten Schlüsselgenerators erzeugten Schlüssels und der in dem Datenbereich enthaltenen Daten, insbesondere dem von dem ersten Firmware-Image umfassten Firmware-Programmcode.Method according to one of claims 4 to 6, wherein generating the second authentication information comprises: Generating a check sum serving as second authentication information according to the second crypto method from a key generated by means of a key generator comprised by the first firmware component and the data contained in the data area, in particular the firmware program code included in the first firmware image. Verfahren nach Anspruch 7, wobei der mittels des Schlüsselgenerators erzeugte Schlüssel in einem persistenten Speicher des Mikrocontrollers abgespeichert wird, und wobei das Durchführen einer Authentifizierung des zweiten Firmware-Images anhand der zweiten Authentifizierungsinformation umfasst: Erzeugen einer Prüfsumme nach dem zweiten Kryptoverfahren aus dem mittels des Schlüsselgenerators erzeugten Schlüssel und der von dem zweiten Firmware-Image umfassten Daten, insbesondere dem von dem zweiten Firmware-Image umfassten Firmware-Programmcode; und Vergleichen der Prüfsumme mit der zweiten Authentifizierungsinformation, wobei die Authentifizierung erfolgreich ist, wenn die Prüfsumme mit der zweiten Authentifizierungsinformation übereinstimmt.The method of claim 7, wherein the key generated by the key generator is stored in persistent memory of the microcontroller, and wherein performing authentication of the second firmware image based on the second authentication information comprises: Generating a checksum according to the second crypto method from the key generated by the key generator and the data comprised by the second firmware image, in particular the firmware program code comprised by the second firmware image; and comparing the checksum with the second authentication information, wherein the authentication is successful if the checksum matches the second authentication information. Verfahren nach Anspruch 7 oder 8, wobei der Schlüsselgenerator einen Zufallszahlengenerator umfasst und wobei der Schlüssel eine Zufallszahlensequenz, insbesondere von mindestens 80 Bits, ist.The method of claim 7 or 8, wherein the key generator comprises a random number generator and wherein the key is a random number sequence, in particular of at least 80 bits. Verfahren nach einem der Ansprüche 1 bis 9, wobei der Firmware-Programmcode des ersten und des zweiten Firmware-Images verschlüsselt ist und wobei das Verfahren weiter umfasst: Entschlüsseln des Firmware-Programmcodes mittels eines zusätzlichen Entschlüsselungsalgorithmus der ersten und/oder der zweiten Firmware-Komponente.Method according to one of claims 1 to 9, wherein the firmware program code of the first and second firmware images is encrypted, and wherein the method further comprises: Decrypting the firmware program code using an additional decryption algorithm of the first and / or the second firmware component. Gerät der Mess- und Regeltechnik umfassend: eine Geräteelektronik mit mindestens einem Mikrocontroller; wobei der mindestens eine Mikrocontroller eine eingebettete Firmware umfasst, welche mindestens eine erste Firmware-Komponente und eine zweite Firmware-Komponente aufweist, und wobei die erste Firmware-Komponente umfasst: – einen oder mehrere Algorithmen zur Bereitstellung von Funktionalitäten des Geräts; – einen Algorithmus zum Empfang eines ersten Firmware-Images, welches einen Datenbereich und ein Signaturfeld umfasst, wobei der Datenbereich zur Aktualisierung der ersten Firmware-Komponente dienende, einen Firmware-Programmcode umfassende, Daten enthält, und wobei das Signaturfeld eine nach einem ersten Kryptoverfahren erzeugte erste Authentifizierungsinformation enthält; – einen Authentifizierungs-Algorithmus zur Authentifizierung des ersten Firmware-Images anhand der ersten Authentifizierungsinformation nach einem ersten Kryptoverfahren; – einen Algorithmus zur Erzeugung einer zweiten Authentifizierungsinformation aus den in dem Datenbereich enthaltenen Daten, insbesondere dem Firmware-Programmcode, nach einem von dem ersten Kryptoverfahren verschiedenen, zweiten Kryptoverfahren; und – einen Algorithmus zur Ablage der zweiten Authentifizierungsinformation in einem persistenten Speicher des Microcontrollers; und wobei die zweite Firmware-Komponente umfasst: – einen Algorithmus zum Empfangen eines zweiten Firmware-Images, welches die zur Aktualisierung der ersten Firmware-Komponente dienenden Daten, insbesondere einen zur Aktualisierung der ersten Firmware-Komponente dienenden Firmware-Programmcode, umfasst; – einen Algorithmus zum Löschen der ersten Firmware-Komponente und zum Speichern des von dem zweiten Firmware-Image umfassten Firmware-Programmcodes als neue erste Firmware-Komponente; – einen Algorithmus zum Auslesen der zweiten Authentifizierungsinformation aus dem persistenten Speicher; – einen Authentifizierungsalgorithmus nach dem zweiten Kryptoverfahren zur Authentifizierung des zweiten Firmware-Images anhand der zweiten Authentifizierungsinformation und der von dem zweiten Firmware-Image umfassten Daten, insbesondere des Firmware-Programmcodes; und – einen Algorithmus zum Aktivschalten der neuen ersten Firmware-Komponente.Instrument of measurement and control technology comprising: a device electronics with at least one microcontroller; wherein the at least one microcontroller comprises embedded firmware having at least a first firmware component and a second firmware component, and wherein the first firmware component comprises: One or more algorithms for providing functionalities of the device; An algorithm for receiving a first firmware image, comprising a data area and a signature field, the data area containing data for updating the first firmware component, comprising firmware program code, and wherein the signature field generates a first-cryptographic process contains first authentication information; An authentication algorithm for authenticating the first firmware image based on the first authentication information after a first crypto procedure; An algorithm for generating a second authentication information from the data contained in the data area, in particular the firmware program code, according to a second crypto method different from the first crypto method; and An algorithm for storing the second authentication information in a persistent memory of the microcontroller; and wherein the second firmware component comprises: An algorithm for receiving a second firmware image which comprises the data for updating the first firmware component, in particular a firmware program code for updating the first firmware component; An algorithm for deleting the first firmware component and storing the firmware program code included in the second firmware image as a new first firmware component; An algorithm for reading out the second authentication information from the persistent storage; An authentication algorithm according to the second crypto-method for authenticating the second firmware image based on the second authentication information and the data included in the second firmware image, in particular the firmware program code; and An algorithm for activating the new first firmware component. Gerät nach Anspruch 11, wobei das erste Kryptoverfahren ein asymmetrisches Kryptoverfahren ist und das zweite Kryptoverfahren ein symmetrisches Kryptoverfahren ist, und wobei die erste Firmware-Komponente weiter umfasst: einen einen Zufallszahlengenerator umfassenden Schlüsselgenerator und einen Algorithmus zur Ablage eines mittels des Schlüsselgenerators erzeugten Schlüssels für das zweite Kryptoverfahren in einem persistenten Speicher des Mikrocontrollers; und wobei der Authentifizierungs-Algorithmus nach dem zweiten Kryptoverfahren dazu ausgestaltet ist, aus dem gespeicherten Schlüssel und den von dem zweiten Firmware-Image umfassten Daten, insbesondere dem Firmware-Programmcode, eine Prüfsumme zu erzeugen und diese mit der zweiten Authentifizierungsinformation zu vergleichen.Apparatus according to claim 11, wherein the first crypto-method is an asymmetric crypto-method and the second crypto-method is a symmetric crypto-method, and wherein the first firmware component further comprises: a key generator comprising a random number generator and an algorithm for storing a key generated by the key generator for the second crypto-method in a persistent memory of the microcontroller; and wherein the authentication algorithm according to the second crypto method is configured to generate a check sum from the stored key and the data comprised by the second firmware image, in particular the firmware program code, and to compare these with the second authentication information. Gerät nach Anspruch 11 oder 12, wobei die erste und/oder die zweite Firmware-Komponente einen weiteren Algorithmus zur Entschlüsselung eines Firmware-Images oder der Daten, die in dem von dem Firmware-Image umfassten Datenbereich enthalten sind, insbesondere eines von dem Firmware-Image umfassten Firmware-Programmcodes, insbesondere mit einem symmetrischen Verschlüsselungsverfahren, umfassen.Apparatus according to claim 11 or 12, wherein the first and / or the second firmware component comprises a further algorithm for decoding a firmware image or the data contained in the data area comprised by the firmware image, in particular one of the firmware. Image include firmware program codes, in particular with a symmetric encryption method include. Gerät nach einem der Ansprüche 11 bis 13, wobei die Übermittlung des ersten und/oder zweiten Firmware-Images an das Gerät unter Nutzung eines leicht angreifbaren Datenübermittlungskanals erfolgt, insbesondere unter Nutzung eines Fernwartungs- oder Funkinterfaces oder unter Verwendung eines transportablen Speichermediums, wie eines USB-Sticks oder einer SD-Karte.Device according to one of claims 11 to 13, wherein the transmission of the first and / or second firmware image to the device using an easily vulnerable data transmission channel, in particular using a remote maintenance or wireless interface or using a portable storage medium, such as a USB Sticks or an SD card. Gerät nach einem der Ansprüche 11 bis 14, wobei das Gerät einen Messwandler aufweist, welcher von einer Messgröße abhängige, insbesondere digitale, Messsignale erzeugt; und die Geräteelektronik eine mit dem Messwandler zum Empfang der Messsignale, insbesondere lösbar oder nicht lösbar, verbundene Messelektronik umfasst, welche dazu ausgestaltet ist, die Messsignale zu verarbeiten und die verarbeiteten Messsignale an eine übergeordnete Einheit auszugeben.Apparatus according to any one of claims 11 to 14, wherein the device comprises a transducer which generates, dependent on a measured variable, in particular digital, measuring signals; and the device electronics comprise a measuring electronics connected to the measuring transducer for receiving the measuring signals, in particular detachably or non-detachably, which is designed to process the measuring signals and to output the processed measuring signals to a higher-order unit.
DE102016106819.5A 2016-04-11 2016-04-13 Method for updating a firmware component and device of measurement and control technology Pending DE102016106819A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710227906.0A CN107368744B (en) 2016-04-11 2017-04-10 Method for updating firmware components and device for measuring and controlling technology
US15/483,208 US10481900B2 (en) 2016-04-11 2017-04-10 Method for updating a firmware component and device of measurement and control technology

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
DE102016106625 2016-04-11
DE102016106625.7 2016-04-11

Publications (1)

Publication Number Publication Date
DE102016106819A1 true DE102016106819A1 (en) 2017-10-26

Family

ID=58464559

Family Applications (1)

Application Number Title Priority Date Filing Date
DE102016106819.5A Pending DE102016106819A1 (en) 2016-04-11 2016-04-13 Method for updating a firmware component and device of measurement and control technology

Country Status (2)

Country Link
CN (1) CN107368744B (en)
DE (1) DE102016106819A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102018211932A1 (en) * 2018-07-18 2020-01-23 Robert Bosch Gmbh Method and device for safely starting a device
DE102021129430A1 (en) 2021-11-11 2023-05-11 Endress+Hauser Flowtec Ag Method for detecting manipulation of data in a network

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102017129698A1 (en) * 2017-12-13 2019-06-13 Endress+Hauser Conducta Gmbh+Co. Kg Method and system for operating an extension on a transmitter of process automation technology
CN108595198B (en) * 2018-04-18 2022-02-22 山东方寸微电子科技有限公司 Safe firmware updating method
CN109033762A (en) * 2018-07-05 2018-12-18 南京云信达科技有限公司 A method of for solving complicated checked object soft ware authorization
CN108933790B (en) * 2018-07-05 2020-12-22 山东省计算中心(国家超级计算济南中心) Encryption method for OTA (over the air) upgrade firmware with high security level
CN110851183B (en) * 2018-08-20 2024-04-12 联想企业解决方案(新加坡)有限公司 Method for fast booting a processor in a multiprocessor architecture
US11055105B2 (en) * 2018-08-31 2021-07-06 Micron Technology, Inc. Concurrent image measurement and execution
CN109671229B (en) * 2019-01-31 2022-01-25 环旭(深圳)电子科创有限公司 Cash register and safety verification method thereof
US11216562B2 (en) * 2019-12-31 2022-01-04 Micron Technology, Inc. Double wrapping for verification

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001061437A2 (en) * 2000-02-17 2001-08-23 General Instrument Corporation Method and system for secure downloading of software
US20040019796A1 (en) * 2002-07-26 2004-01-29 Hung-Jung Wang System and method for firmware authentication
US6718374B1 (en) * 1999-04-21 2004-04-06 General Instrument Corporation Method and system for identifying and downloading appropriate software or formware specific to a particular model of set-top box in a cable television system
US20110276958A1 (en) * 2010-05-06 2011-11-10 Canon Kabushiki Kaisha Information processing apparatus and firmware application method
EP1619824B1 (en) * 1998-03-25 2013-07-10 Thomson Licensing Authentification of data in a digital transmission system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7457945B2 (en) * 2004-03-23 2008-11-25 Dell Products L.P. System and method for providing a secure firmware update to a device in a computer system
EP1645931A1 (en) * 2004-10-11 2006-04-12 Telefonaktiebolaget LM Ericsson (publ) Secure loading and storing of data in a data processing device
DE102006054421A1 (en) * 2006-11-16 2008-05-21 Endress + Hauser Gmbh + Co. Kg Device i.e. field device, for determining and/or monitoring e.g. flow, has signal processing unit that is exchangeably designed, where different processing units are utilized based on preset measurement accuracy of measurement values
EP2453352A1 (en) * 2010-11-08 2012-05-16 Gemalto SA Software updating process for an embedded device
US9792439B2 (en) * 2012-09-19 2017-10-17 Nxp B.V. Method and system for securely updating firmware in a computing device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1619824B1 (en) * 1998-03-25 2013-07-10 Thomson Licensing Authentification of data in a digital transmission system
US6718374B1 (en) * 1999-04-21 2004-04-06 General Instrument Corporation Method and system for identifying and downloading appropriate software or formware specific to a particular model of set-top box in a cable television system
WO2001061437A2 (en) * 2000-02-17 2001-08-23 General Instrument Corporation Method and system for secure downloading of software
US20040019796A1 (en) * 2002-07-26 2004-01-29 Hung-Jung Wang System and method for firmware authentication
US20110276958A1 (en) * 2010-05-06 2011-11-10 Canon Kabushiki Kaisha Information processing apparatus and firmware application method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Des. Codes Cryptogr. (2015) 77:493–514
ITU-T Standard X.509
Standard ANS X9.62, http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102018211932A1 (en) * 2018-07-18 2020-01-23 Robert Bosch Gmbh Method and device for safely starting a device
DE102021129430A1 (en) 2021-11-11 2023-05-11 Endress+Hauser Flowtec Ag Method for detecting manipulation of data in a network

Also Published As

Publication number Publication date
CN107368744A (en) 2017-11-21
CN107368744B (en) 2020-11-06

Similar Documents

Publication Publication Date Title
DE102016106819A1 (en) Method for updating a firmware component and device of measurement and control technology
EP2899714B1 (en) Secure provision of a key
EP2742643B1 (en) Device and method for decrypting data
EP3123689B1 (en) Method and system for improving the data security during a communication process
DE102016219926A1 (en) Method, sender and receiver for authentication and integrity protection of message content
DE102015209116A1 (en) Method and update gateway for updating an embedded controller
WO2014131539A1 (en) Generating a key derived from a cryptographic key using a physically unclonable function
DE102015202935A1 (en) Method for manipulation protection
EP3136285A1 (en) Method and memory module for security protected write and/or read operations on the memory module
EP3413530B1 (en) Method and device for exchanging messages
EP3506144A1 (en) Method and system for checking an integrity of a communication
DE102014106727A1 (en) Method for sending / receiving a message by means of an encrypted wireless connection
DE102017102677A1 (en) Method for authenticating a field device of automation technology
EP3337085B1 (en) Reloading cryptographic program instructions
EP3432185A1 (en) Method and network device for protecting a device using at least one key pair generated using asymmetric encryption for encrypted communication and/or authentication against manipulation
EP3718263A1 (en) Method and control system for controlling and/or monitoring devices
DE102015225270A1 (en) Method and security module for providing a security function for a device
EP3525390A1 (en) Device and method for providing at least one secure cryptographic key for cryptographically protecting data initiated by a control device
EP3895387B1 (en) Communication module
EP3407181A1 (en) Method and device for computer-supported processing of a random bit pattern
EP3422234B1 (en) Container image, computer program product and method
WO2020126236A1 (en) Method for operating a distributed database system, distributed database system, and industrial automation system
EP3804209A1 (en) Method having safe-error defensive measure
EP3627755A1 (en) Method for secure communication in a communication network having a plurality of units with different security levels
DE102021110766B3 (en) Forensics module and embedded system

Legal Events

Date Code Title Description
R163 Identified publications notified
R012 Request for examination validly filed