CN104571962A - Implementation method of firmware in USBKEY suitable for batch production - Google Patents

Implementation method of firmware in USBKEY suitable for batch production Download PDF

Info

Publication number
CN104571962A
CN104571962A CN201410854502.0A CN201410854502A CN104571962A CN 104571962 A CN104571962 A CN 104571962A CN 201410854502 A CN201410854502 A CN 201410854502A CN 104571962 A CN104571962 A CN 104571962A
Authority
CN
China
Prior art keywords
equipment
firmware
usbkey
agreement
udk
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.)
Granted
Application number
CN201410854502.0A
Other languages
Chinese (zh)
Other versions
CN104571962B (en
Inventor
胡永刚
沈勇坚
王翔平
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.)
Dynamicode Co Ltd
Original Assignee
Dynamicode Co Ltd
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 Dynamicode Co Ltd filed Critical Dynamicode Co Ltd
Priority to CN201410854502.0A priority Critical patent/CN104571962B/en
Publication of CN104571962A publication Critical patent/CN104571962A/en
Application granted granted Critical
Publication of CN104571962B publication Critical patent/CN104571962B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/38Universal adapter
    • G06F2213/3854Control is performed at the peripheral side

Abstract

The invention discloses an implementation method of firmware in USBKEY suitable for batch production. According to the method, fixed enumeration response information and equipment protocol response information of different protocols are prewritten. At an enumeration request phase, a PC (personal computer) can transmit an enumeration request command and a firmware decomposition request command, and prefixed enumeration information is returned to the PC. The PC can correspondingly process USB (universal serial bus) equipment, the equipment is recognized as a UDK (unreal development kit) if UDK fixing enumeration information is returned, and the equipment is recognized as a CCID (chip/smart card interface device). After corresponding recognition, a communication phase is started, each protocol has a fixed format, the information is correspondingly processed according to commands of the protocols, and corresponding data can be returned. By the firmware design method, production links can be simplified, and the production efficiency of the USBKEY is greatly improved.

Description

The implementation method of firmware in a kind of USBKEY equipment of applicable batch production
Technical field
The present invention relates to a kind of USBKEY technology, be specifically related to the firmware techniques of a kind of USBKEY.
Background technology
USB Key is a kind of hardware device of USB interface.Its built-in single-chip microcomputer or intelligent card chip, has certain storage space, can store private key and the digital certificate of user, and the public key algorithm utilizing USB Key built-in realizes the certification to user identity.Because private key for user is kept in coded lock, make in theory all cannot read in any way, therefore ensure that the security of user authentication.
Because USBKEY obtains a wide range of applications in security fields, so the production firm of USBKEY is when providing product, often need to be supplied to the very large product of customer quantity at the appointed time, this just needs the production efficiency improving USBKEY.
But because different customer requirements is inconsistent, such as require that the communications protocol of USBKEY bottom has plenty of CCID agreement, have plenty of UDK agreement, or other agreement, when causing producing, the tool of production of initialize data is of a great variety, and bad maintenance, reduces the production efficiency of USBKEY on the contrary.
A problem is in addition that current PC end only has UDK agreement can support port binding function, the specific multiple port transmission program data of HUB can be given when not power-off, data can be sent to multiple port after wanting power-off again to plug identification when other agreement, if the quantity that USBKEY produces is large, but also need continuous power-off and power on, this will affect efficiency greatly.
Summary of the invention
For problem existing in existing USBKEY production run, in the USBKEY equipment that the object of the present invention is to provide a kind of applicable batch production, the implementation method of firmware, can greatly improve the production efficiency of USBKEY.
In order to achieve the above object, the present invention adopts following technical scheme:
An implementation method for firmware in the USBKEY equipment of applicable batch production, described method comprises the steps:
(1) in the firmware program of USBKEY equipment, the fixing response message enumerating response message and devices communicating agreement of different agreement is write in advance;
(2) in the enumeration request stage, PC can send out enumeration request order, and firmware decomposes request command, according to different requests, enumerates response message, then return to PC what fix in advance;
(3) information that PC returns according to USB firmware processes accordingly: if return the fixing enumerations information of UDK, equipment is just identified as UDK equipment; If return CCID to fix enumerations information, equipment is just identified as CCID equipment;
(4), after setting into relevant device, in the entry communication stage, according to the communication format of corresponding agreement, process accordingly, and return corresponding data.
In a preferred version, the specific implementation process of described method is as follows:
(1) first the fixing enumerations information of associated communication agreement and corresponding communications protocol are set in the firmware program of USBKEY equipment;
(2) in the USBKEY equipment process that powers on of first time, PC can send enumeration request information, single UDK agreement enumerated into by firmware, PC end will identify this agreement, recycle special production port the Bind tool, USBKEY to corresponding port sends special prefab data, after related data write, then writes the zone bit of user communication protocol-specific;
(3) USBKEY device powers down restarts, and judges the device type enumerated, then corresponding enumerations information is returned when firmware is restarted according to zone bit, makes USBKEY equipment form corresponding communications protocol equipment.
Further, in described step (2) when writing the zone bit of user communication protocol-specific, being called the read/write function of FLASH by the firmware program in USBKEY equipment, the address determined in USB device built-in FLASH writes corresponding data.
The firmware implementation method of USBKEY inside provided by the invention, namely can utilize UDK agreement to carry out prefab data operation in production phase unification; The CCID communications protocol required for client can be become in operational phase, complete normal user function; Adopt the firmware design method of this programme, can production link be simplified, significantly improve the production efficiency of USBKEY.
Accompanying drawing explanation
Fig. 1 be in the present invention in USBKEY firmware realize principle schematic;
Fig. 2 is the concrete processing flow chart in the present invention.
Embodiment
The technological means realized to make the present invention, creation characteristic, reaching object and effect is easy to understand, below in conjunction with concrete diagram, setting forth the present invention further.
First the present invention can realize the enumerations information of agreement and the treatment schemees of corresponding communications protocol such as UDK agreement, CCID in firmware program, by in the firmware program of USB, write the fixing response message enumerating response message and device protocol of different agreement in advance.
In the enumeration request stage, PC can send out enumeration request order, and firmware decomposes request command, according to different requests, enumerations information fixing in advance, then returns to PC.
The information that PC just can return according to USB firmware, carries out corresponding process to this USB device: if return the fixing enumerations information of UDK, equipment is just identified as UDK equipment, if return CCID to fix enumerations information, equipment is just identified as CCID equipment.
After not becoming relevant device, in the entry communication stage, often kind of agreement has set form, according to the order of agreement, does corresponding process, returns corresponding data.
Based on above-mentioned principle, concrete scheme of the present invention is as follows:
See Fig. 1, what it to be depicted as in this programme firmware in USBKEY realizes principle schematic.As seen from the figure, in this firmware program, the process of UDK communications protocol and CCID communications protocol two kinds of agreements and mutual switching is realized.Whole process is divided into three phases: before production, when producing and after production completes.
Before manufacture, in firmware program, the complete process of two kinds of usb protocols is achieved: the passage process of enumerating terminal point information and CCID of CCID, the passage process of enumerating terminal point information and UDK of UDK.
In the production phase, time before agreement does not switch, USBKEY equipment acquiescence is UDK agreement, firmware only can receive the data that UDK end points sends, like this in the USBKEY equipment process that powers on of first time, PC can send enumeration request information, and firmware decomposes request command, because USBKEY equipment acquiescence is UDK agreement, therefore single UDK agreement enumerated into by firmware.PC holds corresponding port will identify this agreement, and PC end will utilize special production port the Bind tool (i.e. the tool of production), send special prefab data (as password or certificate) by UDK end points to the USBKEY of corresponding port; Firmware receives after PC holds the data sent, the COS system calling USBKEY is carried out the read-write of data, after prefab data has been read and write, write the zone bit (i.e. the certain bits of corresponding FLASH) of user communication protocol-specific again, be used for representing the agreement (i.e. CCID agreement) that next time will switch to.
When writing the zone bit of user communication protocol-specific, firmware program calls the read/write function of FLASH, and the address determined in the FLASH that USB device is built-in writes corresponding zone bit data, if write data 1, the data so on this address are exactly 1; Write 2, on this address, data are exactly 2.Wherein, data 0: the equipment representing single UDK; Data 1: the equipment representing CCID agreement; The equipment complex of data 2:CCID+UDK.
After production phase completes, after USBKEY re-powers, whether first USBKEY detects is the acquiescence operating protocol (as single UDK agreement) of USB; If not, then detect zone bit, according to the zone bit producing write, be switched to the agreement (i.e. CCID agreement) of user job, USBKEY will enumerate into CCID agreement.Now, this USBKEY recognition of devices is become CCID equipment by PC end, utilizes CCID passage and USBKEY to carry out communication, and according to reception APDU order, COS process, the flow process returning CCID data is gone round and begun again, and now UDK passage just no longer receives prefab data.
This process is when specific implementation, and write zone bit in FLASH after, USB device needs plug again, after again powering on, when PC sends respective request, according to the zone bit of the FLASH write before, returns to the facility information after PC switching:
If 1, the data of fixedly enumerating of CCID are returned PC, such PC just treats as USB device the equipment of CCID.If be cut into CCID agreement, just fixing CCID protocol information is returned PC, equipment is just identified as CCID equipment naturally.Because do not return the facility information of UDK, PC also would not USB device as UDK equipment.
When carrying out realizing USBKEY internal firmware based on such scheme, UDK agreement can either be utilized to carry out initialize data operation in the production phase, effectively can avoid like this adopting the different tools of production according to different agreements, cause the tool of production of a great variety, the problem that bad maintenance lowers efficiency; Simultaneously can also can become CCID communications protocol needed for client in USBKEY operational phase, complete normal user function, can effectively avoid like this USBKEY in process of production constantly power-off again plug the problem identifying and affect efficiency.
Except realizing CCID communications protocol, other communications protocol can also be realized equally by such scheme and fixing, concrete realize principle and scheme is same as described above, do not repeated herein.
See Fig. 2, it is depicted as such scheme in the specific implementation, the main working process figure of USBKEY firmware.As seen from the figure, whole process flow is as follows:
1, USBKEY equipment is from principal function main () entrance, first carries out the initialization of related device,
2, the switching mark of usb protocol is read, ready for enumerating process.
First the appropriate address data in FLASH are read, this address is not write before manufacture, it is default value 0 as read out, expression is the equipment of single UDK, so first, PC to enumerating end points, can send enumerations information request, after USB device receives, the fixed data (as the figure left side) only having UDK information will be returned, so PC has just treated as UDK equipment USB device to PC.This time, the identification of equipment just completed.
3, accordingly, enter the major cycle process of while (1), process the data of various application.
What 4, first receive is the interruption of enumerating end points, after receiving enumeration request, firmware, according to the occurrence of the protocol switching indexed variable read in step (2), does corresponding answer treatment: if the value of protocol switching indexed variable points to CCID agreement, then return CCID enumerations information; If the value of protocol switching indexed variable points to UDK agreement, then return UDK enumerations information.
5, USBKEY equipment enters into the process of fetch equipment, according to the enumerations information returned, device enumeration is become corresponding protocol devices: if enumerate into the agreement of UDK, equipment is received by UDK end points and reads UDK protocol massages data, and therefrom function decomposition into analytic function goes out the data of APDU, call COS system again to process, response data is returned to by UDK passage again;
If enumerate into the agreement of CCID, equipment is received by CCID end points and reads CCID protocol massages data, and therefrom function decomposition into analytic function goes out the data of APDU, then calls COS system and process, and response data is returned to by CCID passage again.Complete the treatment scheme of data thus.
Complete after relevant device do not become based on such scheme, can enter into the communication stage, PC sends the protocol data of UDK to the end points of UDK, after equipment receives, processes corresponding UDK agreement, returns to the process data of PC.Last in process, if send the special instruction of handoff protocol, after equipment receives, will to the determination address of FLASH, write switching value, represents the lower secondary agreement switched to, such as writes 1, just represent next power-off, after reinserting, become CCID agreement.
Before power-off again, the protocol processes flow process code of CCID can't perform, because the agreement of current or single UDK, after re-powering, workflow graph in execution, because protocol switching value changes, so when device enumeration, equipment can judge that this value (the figure left side) is if the value of CCID, will return the fix information of CCID, like this, equipment just becomes the equipment of CCID instead of UDK equipment.
As from the foregoing, when producing, only use and enumerate end points and UDK Path end point, the flow process of CCID can not be gone to.
Produce, after re-powering, switched to CCID, enumerated end points and CCID Path end point with regard to only using and UDK Path end point can not be used.
More than show and describe ultimate principle of the present invention and principal character and advantage of the present invention.The technician of the industry should understand; the present invention is not restricted to the described embodiments; what describe in above-described embodiment and instructions just illustrates principle of the present invention; without departing from the spirit and scope of the present invention; the present invention also has various changes and modifications, and these changes and improvements all fall in the claimed scope of the invention.Application claims protection domain is defined by appending claims and equivalent thereof.

Claims (3)

1. the implementation method of firmware in the USBKEY equipment being applicable to batch production, it is characterized in that, described method comprises the steps:
(1) in the firmware program of USBKEY equipment, the fixing response message enumerating response message and devices communicating agreement of different agreement is write in advance;
(2) in the enumeration request stage, PC can send out enumeration request order, and firmware decomposes request command, according to different requests, enumerates response message, then return to PC what fix in advance;
(3) information that PC returns according to USB firmware processes accordingly: if return the fixing enumerations information of UDK, equipment is just identified as UDK equipment; If return CCID to fix enumerations information, equipment is just identified as CCID equipment;
(4), after setting into relevant device, in the entry communication stage, according to the communication format of corresponding agreement, process accordingly, and return corresponding data.
2. the implementation method of firmware in the USBKEY equipment of a kind of applicable batch production according to claim 1, it is characterized in that, the specific implementation process of described method is as follows:
(1) first the fixing enumerations information of associated communication agreement and corresponding communications protocol are set in the firmware program of USBKEY equipment;
(2) in the USBKEY equipment process that powers on of first time, PC can send enumeration request information, single UDK agreement enumerated into by firmware, PC end will identify this agreement, recycle special production port the Bind tool, USBKEY to corresponding port sends special prefab data, after related data write, then writes the zone bit of user communication protocol-specific;
(3) USBKEY device powers down restarts, and judges the device type enumerated, then corresponding enumerations information is returned when firmware is restarted according to zone bit, makes USBKEY equipment form corresponding communications protocol equipment.
3. the implementation method of firmware in the USBKEY equipment of a kind of applicable batch production according to claim 2, it is characterized in that, in described step (2) when writing the zone bit of user communication protocol-specific, called the read/write function of FLASH by the firmware program in USBKEY equipment, the address determined in USB device built-in FLASH writes corresponding data.
CN201410854502.0A 2014-12-31 2014-12-31 The implementation method of firmware in a kind of USBKEY equipment of suitable batch production Active CN104571962B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410854502.0A CN104571962B (en) 2014-12-31 2014-12-31 The implementation method of firmware in a kind of USBKEY equipment of suitable batch production

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410854502.0A CN104571962B (en) 2014-12-31 2014-12-31 The implementation method of firmware in a kind of USBKEY equipment of suitable batch production

Publications (2)

Publication Number Publication Date
CN104571962A true CN104571962A (en) 2015-04-29
CN104571962B CN104571962B (en) 2017-11-17

Family

ID=53088147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410854502.0A Active CN104571962B (en) 2014-12-31 2014-12-31 The implementation method of firmware in a kind of USBKEY equipment of suitable batch production

Country Status (1)

Country Link
CN (1) CN104571962B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255648A (en) * 2016-12-28 2018-07-06 航天信息股份有限公司 A kind of production test method and system of electron key USBKey
CN108877188A (en) * 2018-05-17 2018-11-23 济南诚博信息科技有限公司 A kind of environment protection digital concurrently acquires and Multi net voting dissemination method and device
WO2023279959A1 (en) * 2021-07-08 2023-01-12 飞天诚信科技股份有限公司 Implementation method and apparatus for increasing number of certificates supported by piv application

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101266590A (en) * 2008-04-22 2008-09-17 北京飞天诚信科技有限公司 Method and system for dynamically switching equipment arrangement
CN101872334A (en) * 2010-05-26 2010-10-27 北京飞天诚信科技有限公司 Compound type usb equipment and implementation method thereof
CN102043751A (en) * 2010-06-29 2011-05-04 北京飞天诚信科技有限公司 Method for identifying host operation system by using USB equipment
US20120159253A1 (en) * 2010-12-17 2012-06-21 Oberthur Technologies Hardware security module and processing method in such a module

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101266590A (en) * 2008-04-22 2008-09-17 北京飞天诚信科技有限公司 Method and system for dynamically switching equipment arrangement
CN101872334A (en) * 2010-05-26 2010-10-27 北京飞天诚信科技有限公司 Compound type usb equipment and implementation method thereof
CN102043751A (en) * 2010-06-29 2011-05-04 北京飞天诚信科技有限公司 Method for identifying host operation system by using USB equipment
US20120159253A1 (en) * 2010-12-17 2012-06-21 Oberthur Technologies Hardware security module and processing method in such a module

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255648A (en) * 2016-12-28 2018-07-06 航天信息股份有限公司 A kind of production test method and system of electron key USBKey
CN108255648B (en) * 2016-12-28 2021-07-20 航天信息股份有限公司 Production test method and system of electronic key USBKey
CN108877188A (en) * 2018-05-17 2018-11-23 济南诚博信息科技有限公司 A kind of environment protection digital concurrently acquires and Multi net voting dissemination method and device
WO2023279959A1 (en) * 2021-07-08 2023-01-12 飞天诚信科技股份有限公司 Implementation method and apparatus for increasing number of certificates supported by piv application

Also Published As

Publication number Publication date
CN104571962B (en) 2017-11-17

Similar Documents

Publication Publication Date Title
CN107851152B (en) Apparatus and method for distributed operation of a security controller
US9111081B2 (en) Remote direct memory access authentication of a device
KR101674515B1 (en) System and method of providing embedded software development environment for IoT device
CN107926075A (en) The system and method for supporting the data communication under isomerous environment
WO2022227818A1 (en) Method and apparatus for network configuration, and smart home device
CN103092799A (en) Universal serial bus (USB) device and method for recognition of host operating system
CN104572564A (en) Method for realizing communication of Android mobile equipment and USB OTG (On-The-Go) host computer
CN105159716B (en) A kind of memory device initial method and electronic equipment
CN104468260A (en) Recognition method, device and system for mobile terminal device
CN104021104A (en) Collaborative system based on dual-bus structure and communication method thereof
CN104571962A (en) Implementation method of firmware in USBKEY suitable for batch production
CN204117142U (en) Electronic device for providing instant switching and sharing of universal serial bus electronic equipment by host
CN104750532A (en) Android-based dual-system land verification PAD (portable android device) and starting method
CN105373422B (en) Controlling terminal equipment enters method, terminal device and the computer equipment of downloading mode
KR102419505B1 (en) Method and system for authentication of a storage device
WO2020000657A1 (en) Method and apparatus for establishing operation and maintenance monitoring connection, terminal device, and medium
CN105159714B (en) A kind of PMIC initial method and electronic equipment
CN107885674B (en) Bluetooth device simulator, working method thereof and Bluetooth device operating system
CN109120731B (en) Universal communication method, system and device
CN110956723A (en) Encryption verification communication method and device for Bluetooth intelligent lock and storage medium
CN103902496A (en) Device and method for USB KEY protocol conversion
CN107133539A (en) Smart card personalization and relevant apparatus and system
CN104597833A (en) PLC protection system and method
JP2010067200A (en) Ic chip, information processing apparatus, software module control method, information processing system and method, and program
CN104950237A (en) Test system and test method for power down protection of smart card

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant