comparison src/cs/drivers/drv_core/security/certificate.c @ 0:b6a5e36de839

src/cs: initial import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 04:39:26 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b6a5e36de839
1 /* @(#) nom : certificate.c SID: 1.2 date : 02/17/03 */
2 /* Filename: certificate.c */
3 /* Version: 1.2 */
4 /******************************************************************************
5 * WIRELESS COMMUNICATION SYSTEM DEVELOPMENT
6 *
7 * (C) 2002 Texas Instruments France. All rights reserved
8 *
9 * Author : Francois AMAND
10 *
11 *
12 * Important Note
13 * --------------
14 *
15 * This S/W is a preliminary version. It contains information on a product
16 * under development and is issued for evaluation purposes only. Features
17 * characteristics, data and other information are subject to change.
18 *
19 * The S/W is furnished under Non Disclosure Agreement and may be used or
20 * copied only in accordance with the terms of the agreement. It is an offence
21 * to copy the software in any way except as specifically set out in the
22 * agreement. No part of this document may be reproduced or transmitted in any
23 * form or by any means, electronic or mechanical, including photocopying and
24 * recording, for any purpose without the express written permission of Texas
25 * Instruments Inc.
26 *
27 ******************************************************************************
28 *
29 * FILE NAME: firmware.c
30 *
31 *
32 * PURPOSE: Simulation of Firmware application located in FLASH.
33 * Used to generate COFF file with certificate management.
34 *
35 *
36 *
37 * FILE REFERENCES:
38 *
39 * Name IO Description
40 * ------------- -- ---------------------------------------------
41 *
42 *
43 *
44 * EXTERNAL VARIABLES:
45 *
46 * Source:
47 *
48 * Name Type IO Description
49 * ------------- --------------- -- ------------------------------
50 *
51 *
52 * EXTERNAL REFERENCES:
53 *
54 * Name Description
55 * ------------------ -------------------------------------------------------
56 *
57 *
58 *
59 * ABNORMAL TERMINATION CONDITIONS, ERROR AND WARNING MESSAGES:
60 *
61 *
62 *
63 * ASSUMPTION, CONSTRAINTS, RESTRICTIONS:
64 *
65 *
66 *
67 * NOTES:
68 *
69 *
70 *
71 * REQUIREMENTS/FUNCTIONAL SPECIFICATION REFERENCES:
72 *
73 *
74 *
75 *
76 * DEVELOPMENT HISTORY:
77 *
78 * Date Name(s) Version Description
79 * ---------- -------------- ------- --------------------------------------
80 *
81 *
82 * ALGORITHM:
83 *
84 *
85 *****************************************************************************/
86
87 #include "l1sw.cfg"
88 #include "chipset.cfg"
89
90 #if (CHIPSET == 12)
91
92 #if (OP_L1_STANDALONE == 0)
93 #include "main/sys_types.h"
94 #else
95 #include "sys_types.h"
96 #endif
97
98
99 typedef unsigned char UWORD8;
100 typedef unsigned short int UWORD16;
101 typedef unsigned long int UWORD32;
102
103 typedef signed long int WORD32;
104
105 typedef unsigned char BOOLEAN;
106
107
108 #include "secure_types.h"
109
110
111 /*
112 * Certificate variable
113 */
114 extern void ResetVector(void);
115 #pragma DATA_SECTION(d_firmware_certificate, ".cert")
116
117 volatile const T_MANUFACTURER_CERTIFICATE d_firmware_certificate =
118 {
119 (UWORD16)sizeof(T_MANUFACTURER_CERTIFICATE), // Size of Certificate
120 (UWORD8)C_CERTTYPE_MAN, // Type of Certificate
121 (UWORD8)C_DEBUGREQUEST, // Confidentiality request
122 (UWORD32)0x00000000L, // Address of code
123 (UWORD32)0x00000000L, // Size of code : To be defined by tool
124 (UWORD32)ResetVector, // Entry point address
125 // Manufacturer Public key : To be defined by tool
126 {
127 //Public Modulus
128 {
129 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
130 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
131 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
132 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
133 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
134 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
135 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
136 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
137 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
138 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
139 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
140 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
141 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
142 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
143 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
144 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L
145 },
146 //Public Modulus length in bytes
147 (UWORD32)1024/8,
148 //Public Exponent
149 0x00000000L,
150 },
151 // Originator Public key : To be defined by tool
152 {
153 //Public Modulus
154 {
155 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
156 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
157 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
158 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
159 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
160 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
161 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
162 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
163 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
164 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
165 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
166 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
167 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
168 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
169 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
170 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L
171 },
172 //Public Modulus length in bytes
173 (UWORD32)1024/8,
174 //Public Exponent
175 0x00000000L,
176 },
177 // Originator Public key Signature
178 {
179 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
180 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
181 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
182 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
183 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
184 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
185 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
186 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L
187 },
188 // Software Signature
189 {
190 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
191 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
192 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
193 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
194 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
195 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
196 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
197 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L
198 },
199 // Configuration parameters
200 {
201 0x0EA5, // CONF_CS5 register
202 0x7BC2, // EXWS_CS5 register
203 0x0000, // EX_CTRL register
204 C_CSIMGNOREQUEST, // CS image request
205 0x01000000L, // FLASH size in bytes
206 1 // Granularity in word
207 },
208 // Certificate Signature
209 {
210 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
211 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
212 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
213 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
214 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
215 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
216 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L,
217 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L
218 }
219 };
220
221 #endif /* (CHIPSET == 12) */