x509_common.c
Go to the documentation of this file.
1 /**
2  * @file x509_common.c
3  * @brief X.509 common definitions
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2026 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneCRYPTO Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.6.4
29  **/
30 
31 //Switch to the appropriate trace level
32 #define TRACE_LEVEL CRYPTO_TRACE_LEVEL
33 
34 //Dependencies
35 #include "core/crypto.h"
36 #include "pkix/x509_common.h"
37 #include "encoding/asn1.h"
38 #include "encoding/oid.h"
39 #include "hash/hash_algorithms.h"
40 #include "debug.h"
41 
42 //Check crypto library configuration
43 #if (X509_SUPPORT == ENABLED)
44 
45 //Common Name OID (2.5.4.3)
46 const uint8_t X509_COMMON_NAME_OID[3] = {0x55, 0x04, 0x03};
47 //Surname OID (2.5.4.4)
48 const uint8_t X509_SURNAME_OID[3] = {0x55, 0x04, 0x04};
49 //Serial Number OID (2.5.4.5)
50 const uint8_t X509_SERIAL_NUMBER_OID[3] = {0x55, 0x04, 0x05};
51 //Country Name OID (2.5.4.6)
52 const uint8_t X509_COUNTRY_NAME_OID[3] = {0x55, 0x04, 0x06};
53 //Locality Name OID (2.5.4.7)
54 const uint8_t X509_LOCALITY_NAME_OID[3] = {0x55, 0x04, 0x07};
55 //State Or Province Name OID (2.5.4.8)
56 const uint8_t X509_STATE_OR_PROVINCE_NAME_OID[] = {0x55, 0x04, 0x08};
57 //Organization Name OID (2.5.4.10)
58 const uint8_t X509_ORGANIZATION_NAME_OID[3] = {0x55, 0x04, 0x0A};
59 //Organizational Unit Name OID (2.5.4.11)
60 const uint8_t X509_ORGANIZATIONAL_UNIT_NAME_OID[3] = {0x55, 0x04, 0x0B};
61 //Title OID (2.5.4.12)
62 const uint8_t X509_TITLE_OID[3] = {0x55, 0x04, 0x0C};
63 //Name OID (2.5.4.41)
64 const uint8_t X509_NAME_OID[3] = {0x55, 0x04, 0x29};
65 //Given Name OID (2.5.4.42)
66 const uint8_t X509_GIVEN_NAME_OID[3] = {0x55, 0x04, 0x2A};
67 //Initials OID (2.5.4.43)
68 const uint8_t X509_INITIALS_OID[3] = {0x55, 0x04, 0x2B};
69 //Generation Qualifier OID (2.5.4.44)
70 const uint8_t X509_GENERATION_QUALIFIER_OID[3] = {0x55, 0x04, 0x2C};
71 //DN Qualifier OID (2.5.4.46)
72 const uint8_t X509_DN_QUALIFIER_OID[3] = {0x55, 0x04, 0x2E};
73 //Pseudonym OID (2.5.4.65)
74 const uint8_t X509_PSEUDONYM_OID[3] = {0x55, 0x04, 0x41};
75 //Domain Component OID (0.9.2342.19200300.100.1.25)
76 const uint8_t X509_DOMAIN_COMPONENT_OID[10] = {0x09, 0x92, 0x26, 0x89, 0x93, 0xF2, 0x2C, 0x64, 0x01, 0x19};
77 
78 //Subject Directory Attributes OID (2.5.29.9)
79 const uint8_t X509_SUBJECT_DIR_ATTR_OID[3] = {0x55, 0x1D, 0x09};
80 //Subject Key Identifier OID (2.5.29.14)
81 const uint8_t X509_SUBJECT_KEY_ID_OID[3] = {0x55, 0x1D, 0x0E};
82 //Key Usage OID (2.5.29.15)
83 const uint8_t X509_KEY_USAGE_OID[3] = {0x55, 0x1D, 0x0F};
84 //Subject Alternative Name OID (2.5.29.17)
85 const uint8_t X509_SUBJECT_ALT_NAME_OID[3] = {0x55, 0x1D, 0x11};
86 //Issuer Alternative Name OID (2.5.29.18)
87 const uint8_t X509_ISSUER_ALT_NAME_OID[3] = {0x55, 0x1D, 0x12};
88 //Basic Constraints OID (2.5.29.19)
89 const uint8_t X509_BASIC_CONSTRAINTS_OID[3] = {0x55, 0x1D, 0x13};
90 //CRL Number OID (2.5.29.20)
91 const uint8_t X509_CRL_NUMBER_OID[3] = {0x55, 0x1D, 0x14};
92 //Reason Code OID (2.5.29.21)
93 const uint8_t X509_REASON_CODE_OID[3] = {0x55, 0x1D, 0x15};
94 //Invalidity Date OID (2.5.29.24)
95 const uint8_t X509_INVALIDITY_DATE_OID[3] = {0x55, 0x1D, 0x18};
96 //Delta CRL Indicator OID (2.5.29.27)
97 const uint8_t X509_DELTA_CRL_INDICATOR_OID[3] = {0x55, 0x1D, 0x1B};
98 //Issuing Distribution Point OID (2.5.29.28)
99 const uint8_t X509_ISSUING_DISTR_POINT_OID[3] = {0x55, 0x1D, 0x1C};
100 //Certificate Issuer OID (2.5.29.29)
101 const uint8_t X509_CERTIFICATE_ISSUER_OID[3] = {0x55, 0x1D, 0x1D};
102 //Name Constraints OID (2.5.29.30)
103 const uint8_t X509_NAME_CONSTRAINTS_OID[3] = {0x55, 0x1D, 0x1E};
104 //CRL Distribution Points OID (2.5.29.31)
105 const uint8_t X509_CRL_DISTR_POINTS_OID[3] = {0x55, 0x1D, 0x1F};
106 //Certificate Policies OID (2.5.29.32)
107 const uint8_t X509_CERTIFICATE_POLICIES_OID[3] = {0x55, 0x1D, 0x20};
108 //Policy Mappings OID (2.5.29.33)
109 const uint8_t X509_POLICY_MAPPINGS_OID[3] = {0x55, 0x1D, 0x21};
110 //Authority Key Identifier OID (2.5.29.35)
111 const uint8_t X509_AUTHORITY_KEY_ID_OID[3] = {0x55, 0x1D, 0x23};
112 //Policy Constraints OID (2.5.29.36)
113 const uint8_t X509_POLICY_CONSTRAINTS_OID[3] = {0x55, 0x1D, 0x24};
114 //Extended Key Usage OID (2.5.29.37)
115 const uint8_t X509_EXTENDED_KEY_USAGE_OID[3] = {0x55, 0x1D, 0x25};
116 //Freshest CRL OID (2.5.29.46)
117 const uint8_t X509_FRESHEST_CRL_OID[3] = {0x55, 0x1D, 0x2E};
118 //Inhibit Any-Policy OID (2.5.29.54)
119 const uint8_t X509_INHIBIT_ANY_POLICY_OID[3] = {0x55, 0x1D, 0x36};
120 //Authority Information Access OID (1.3.6.1.5.5.7.1.1)
121 const uint8_t X509_AUTH_INFO_ACCESS_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01};
122 //PKIX OCSP No Check OID (1.3.6.1.5.5.7.48.1.5)
123 const uint8_t X509_PKIX_OCSP_NO_CHECK_OID[9] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x05};
124 //Netscape Certificate Type OID (2.16.840.1.113730.1.1)
125 const uint8_t X509_NS_CERT_TYPE_OID[9] = {0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x42, 0x01, 0x01};
126 
127 //Any Extended Key Usage OID (2.5.29.37.0)
128 const uint8_t X509_ANY_EXT_KEY_USAGE_OID[4] = {0x55, 0x1D, 0x25, 0x00};
129 //Key Purpose Server Auth OID (1.3.6.1.5.5.7.3.1)
130 const uint8_t X509_KP_SERVER_AUTH_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01};
131 //Key Purpose Client Auth OID (1.3.6.1.5.5.7.3.2)
132 const uint8_t X509_KP_CLIENT_AUTH_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02};
133 //Key Purpose Code Signing OID (1.3.6.1.5.5.7.3.3)
134 const uint8_t X509_KP_CODE_SIGNING_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03};
135 //Key Purpose Email Protection OID (1.3.6.1.5.5.7.3.4)
136 const uint8_t X509_KP_EMAIL_PROTECTION_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04};
137 //Key Purpose IPsec End System OID (1.3.6.1.5.5.7.3.5)
138 const uint8_t X509_KP_IPSEC_END_SYSTEM_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x05};
139 //Key Purpose IPsec Tunnel OID (1.3.6.1.5.5.7.3.6)
140 const uint8_t X509_KP_IPSEC_TUNNEL_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x06};
141 //Key Purpose IPsec User OID (1.3.6.1.5.5.7.3.7)
142 const uint8_t X509_KP_IPSEC_USER_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x07};
143 //Key Purpose Time Stamping OID (1.3.6.1.5.5.7.3.8)
144 const uint8_t X509_KP_TIME_STAMPING_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x08};
145 //Key Purpose OCSP Signing OID (1.3.6.1.5.5.7.3.9)
146 const uint8_t X509_KP_OCSP_SIGNING_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x09};
147 //Key Purpose IPsec IKE OID (1.3.6.1.5.5.7.3.17)
148 const uint8_t X509_KP_IPSEC_IKE_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x11};
149 //Key Purpose Secure Shell Client OID (1.3.6.1.5.5.7.3.21)
150 const uint8_t X509_KP_SSH_CLIENT_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x15};
151 //Key Purpose Secure Shell Client OID (1.3.6.1.5.5.7.3.22)
152 const uint8_t X509_KP_SSH_SERVER_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x16};
153 //Key Purpose CMC Certification Authorities OID (1.3.6.1.5.5.7.3.27)
154 const uint8_t X509_KP_CMC_CA_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x1B};
155 //Key Purpose CMC Registration Authorities OID (1.3.6.1.5.5.7.3.28)
156 const uint8_t X509_KP_CMC_RA_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x1C};
157 //Key Purpose Document Signing OID (1.3.6.1.5.5.7.3.36)
158 const uint8_t X509_KP_DOC_SIGNING_OID[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x24};
159 
160 //Access Description CA Issuers OID (1.3.6.1.5.5.7.48.1)
161 const uint8_t X509_AD_CA_ISSUERS[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01};
162 //Access Description OCSP (1.3.6.1.5.5.7.48.2)
163 const uint8_t X509_AD_OCSP[8] = {0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02};
164 
165 //PKCS #9 E-mail Address OID (1.2.840.113549.1.9.1)
166 const uint8_t PKCS9_EMAIL_ADDR_OID[9] = {0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01};
167 //PKCS #9 Challenge Password OID (1.2.840.113549.1.9.7)
168 const uint8_t PKCS9_CHALLENGE_PASSWORD_OID[9] = {0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x07};
169 //PKCS #9 Extension Request OID (1.2.840.113549.1.9.14)
170 const uint8_t PKCS9_EXTENSION_REQUEST_OID[9] = {0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x0E};
171 
172 //Default certificate parsing options
174 {
175  FALSE //Ignore unknown extensions
176 };
177 
178 
179 /**
180  * @brief Compare distinguished names
181  * @param[in] name1 Pointer to the first distinguished name
182  * @param[in] nameLen1 Length of the first distinguished name
183  * @param[in] name2 Pointer to the second distinguished name
184  * @param[in] nameLen2 Length of the second distinguished name
185  * @return Comparison result
186  **/
187 
188 bool_t x509CompareName(const uint8_t *name1, size_t nameLen1,
189  const uint8_t *name2, size_t nameLen2)
190 {
191  //Compare the length of the distinguished names
192  if(nameLen1 != nameLen2)
193  return FALSE;
194 
195  //Compare the contents of the distinguished names
196  if(osMemcmp(name1, name2, nameLen1))
197  return FALSE;
198 
199  //The distinguished names match
200  return TRUE;
201 }
202 
203 
204 /**
205  * @brief Check whether a given signature algorithm is supported
206  * @param[in] signAlgo signature algorithm
207  * @return TRUE is the signature algorithm is supported, else FALSE
208  **/
209 
211 {
212  bool_t acceptable;
213 
214  //Invalid signature algorithm?
215  if(signAlgo == X509_SIGN_ALGO_NONE)
216  {
217  acceptable = FALSE;
218  }
219 #if (X509_RSA_SUPPORT == ENABLED && RSA_SUPPORT == ENABLED)
220  //RSA signature algorithm?
221  else if(signAlgo == X509_SIGN_ALGO_RSA)
222  {
223  acceptable = TRUE;
224  }
225 #endif
226 #if (X509_RSA_PSS_SUPPORT == ENABLED && RSA_SUPPORT == ENABLED)
227  //RSA-PSS signature algorithm?
228  else if(signAlgo == X509_SIGN_ALGO_RSA_PSS)
229  {
230  acceptable = TRUE;
231  }
232 #endif
233 #if (X509_DSA_SUPPORT == ENABLED && DSA_SUPPORT == ENABLED)
234  //DSA signature algorithm?
235  else if(signAlgo == X509_SIGN_ALGO_DSA)
236  {
237  acceptable = TRUE;
238  }
239 #endif
240 #if (X509_ECDSA_SUPPORT == ENABLED && ECDSA_SUPPORT == ENABLED)
241  //ECDSA signature algorithm?
242  else if(signAlgo == X509_SIGN_ALGO_ECDSA)
243  {
244  acceptable = TRUE;
245  }
246 #endif
247 #if (X509_SM2_SUPPORT == ENABLED && SM2_SUPPORT == ENABLED)
248  //SM2 signature algorithm?
249  else if(signAlgo == X509_SIGN_ALGO_SM2)
250  {
251  acceptable = TRUE;
252  }
253 #endif
254 #if (X509_ED25519_SUPPORT == ENABLED && ED25519_SUPPORT == ENABLED)
255  //Ed25519 signature algorithm?
256  else if(signAlgo == X509_SIGN_ALGO_ED25519)
257  {
258  acceptable = TRUE;
259  }
260 #endif
261 #if (X509_ED448_SUPPORT == ENABLED && ED448_SUPPORT == ENABLED)
262  //Ed448 signature algorithm?
263  else if(signAlgo == X509_SIGN_ALGO_ED448)
264  {
265  acceptable = TRUE;
266  }
267 #endif
268 #if (X509_MLDSA44_SUPPORT == ENABLED && MLDSA44_SUPPORT == ENABLED)
269  //ML-DSA-44 signature algorithm?
270  else if(signAlgo == X509_SIGN_ALGO_MLDSA44)
271  {
272  acceptable = TRUE;
273  }
274 #endif
275 #if (X509_MLDSA65_SUPPORT == ENABLED && MLDSA65_SUPPORT == ENABLED)
276  //ML-DSA-65 signature algorithm?
277  else if(signAlgo == X509_SIGN_ALGO_MLDSA65)
278  {
279  acceptable = TRUE;
280  }
281 #endif
282 #if (X509_MLDSA87_SUPPORT == ENABLED && MLDSA87_SUPPORT == ENABLED)
283  //ML-DSA-87 signature algorithm?
284  else if(signAlgo == X509_SIGN_ALGO_MLDSA87)
285  {
286  acceptable = TRUE;
287  }
288 #endif
289  //Invalid signature algorithm?
290  else
291  {
292  acceptable = FALSE;
293  }
294 
295  //Return TRUE is the signature algorithm is supported
296  return acceptable;
297 }
298 
299 
300 /**
301  * @brief Check whether a given hash algorithm is supported
302  * @param[in] hashAlgo signature hash
303  * @return TRUE is the signature hash is supported, else FALSE
304  **/
305 
307 {
308  bool_t acceptable;
309 
310  //Invalid hash algorithm?
311  if(hashAlgo == X509_HASH_ALGO_NONE)
312  {
313  acceptable = FALSE;
314  }
315 #if (X509_MD5_SUPPORT == ENABLED && MD5_SUPPORT == ENABLED)
316  //MD5 hash algorithm?
317  else if(hashAlgo == X509_HASH_ALGO_MD5)
318  {
319  acceptable = TRUE;
320  }
321 #endif
322 #if (X509_SHA1_SUPPORT == ENABLED && SHA1_SUPPORT == ENABLED)
323  //SHA-1 hash algorithm?
324  else if(hashAlgo == X509_HASH_ALGO_SHA1)
325  {
326  acceptable = TRUE;
327  }
328 #endif
329 #if (X509_SHA224_SUPPORT == ENABLED && SHA224_SUPPORT == ENABLED)
330  //SHA-224 hash algorithm?
331  else if(hashAlgo == X509_HASH_ALGO_SHA224)
332  {
333  acceptable = TRUE;
334  }
335 #endif
336 #if (X509_SHA256_SUPPORT == ENABLED && SHA256_SUPPORT == ENABLED)
337  //SHA-256 hash algorithm?
338  else if(hashAlgo == X509_HASH_ALGO_SHA256)
339  {
340  acceptable = TRUE;
341  }
342 #endif
343 #if (X509_SHA384_SUPPORT == ENABLED && SHA384_SUPPORT == ENABLED)
344  //SHA-384 hash algorithm?
345  else if(hashAlgo == X509_HASH_ALGO_SHA384)
346  {
347  acceptable = TRUE;
348  }
349 #endif
350 #if (X509_SHA512_SUPPORT == ENABLED && SHA512_SUPPORT == ENABLED)
351  //SHA-512 hash algorithm?
352  else if(hashAlgo == X509_HASH_ALGO_SHA512)
353  {
354  acceptable = TRUE;
355  }
356 #endif
357 #if (X509_SHA3_224_SUPPORT == ENABLED && SHA3_224_SUPPORT == ENABLED)
358  //SHA3-224 hash algorithm?
359  else if(hashAlgo == X509_HASH_ALGO_SHA3_224)
360  {
361  acceptable = TRUE;
362  }
363 #endif
364 #if (X509_SHA3_256_SUPPORT == ENABLED && SHA3_256_SUPPORT == ENABLED)
365  //SHA3-256 hash algorithm?
366  else if(hashAlgo == X509_HASH_ALGO_SHA3_256)
367  {
368  acceptable = TRUE;
369  }
370 #endif
371 #if (X509_SHA3_384_SUPPORT == ENABLED && SHA3_384_SUPPORT == ENABLED)
372  //SHA3-384 hash algorithm?
373  else if(hashAlgo == X509_HASH_ALGO_SHA3_384)
374  {
375  acceptable = TRUE;
376  }
377 #endif
378 #if (X509_SHA3_512_SUPPORT == ENABLED && SHA3_512_SUPPORT == ENABLED)
379  //SHA3-512 hash algorithm?
380  else if(hashAlgo == X509_HASH_ALGO_SHA3_512)
381  {
382  acceptable = TRUE;
383  }
384 #endif
385 #if (X509_SM3_SUPPORT == ENABLED && SM3_SUPPORT == ENABLED)
386  //SM3 hash algorithm?
387  else if(hashAlgo == X509_HASH_ALGO_SM3)
388  {
389  acceptable = TRUE;
390  }
391 #endif
392  //Invalid hash algorithm?
393  else
394  {
395  acceptable = FALSE;
396  }
397 
398  //Return TRUE is the hash algorithm is supported
399  return acceptable;
400 }
401 
402 
403 /**
404  * @brief Check whether a given elliptic curve is supported
405  * @param[in] oid Object identifier
406  * @param[in] length Length of the OID, in bytes
407  * @return TRUE is the elliptic curve is supported, else FALSE
408  **/
409 
410 bool_t x509IsCurveSupported(const uint8_t *oid, size_t length)
411 {
412  //Return TRUE is the elliptic curve is supported
413  if(x509GetCurve(oid, length) != NULL)
414  {
415  return TRUE;
416  }
417  else
418  {
419  return FALSE;
420  }
421 }
422 
423 
424 /**
425  * @brief Get the signature and hash algorithms that match the specified
426  * identifier
427  * @param[in] signAlgoId Signature algorithm identifier
428  * @param[out] signAlgo Signature algorithm
429  * @param[out] hashAlgo Hash algorithm
430  * @return Error code
431  **/
432 
434  X509SignatureAlgo *signAlgo, const HashAlgo **hashAlgo)
435 {
436  error_t error;
437  size_t oidLen;
438  const uint8_t *oid;
439 
440  //Initialize status code
441  error = NO_ERROR;
442 
443  //Point to the object identifier
444  oid = signAlgoId->oid.value;
445  oidLen = signAlgoId->oid.length;
446 
447  //Just for sanity
448  (void) oid;
449  (void) oidLen;
450 
451 #if (X509_RSA_SUPPORT == ENABLED && RSA_SUPPORT == ENABLED)
452 #if (X509_MD5_SUPPORT == ENABLED && MD5_SUPPORT == ENABLED)
453  //RSA with MD5 signature algorithm?
455  {
456  *signAlgo = X509_SIGN_ALGO_RSA;
457  *hashAlgo = MD5_HASH_ALGO;
458  }
459  else
460 #endif
461 #if (X509_SHA1_SUPPORT == ENABLED && SHA1_SUPPORT == ENABLED)
462  //RSA with SHA-1 signature algorithm?
464  {
465  *signAlgo = X509_SIGN_ALGO_RSA;
466  *hashAlgo = SHA1_HASH_ALGO;
467  }
468  else
469 #endif
470 #if (X509_SHA224_SUPPORT == ENABLED && SHA224_SUPPORT == ENABLED)
471  //RSA with SHA-224 signature algorithm?
473  {
474  *signAlgo = X509_SIGN_ALGO_RSA;
475  *hashAlgo = SHA224_HASH_ALGO;
476  }
477  else
478 #endif
479 #if (X509_SHA256_SUPPORT == ENABLED && SHA256_SUPPORT == ENABLED)
480  //RSA with SHA-256 signature algorithm?
482  {
483  *signAlgo = X509_SIGN_ALGO_RSA;
484  *hashAlgo = SHA256_HASH_ALGO;
485  }
486  else
487 #endif
488 #if (X509_SHA384_SUPPORT == ENABLED && SHA384_SUPPORT == ENABLED)
489  //RSA with SHA-384 signature algorithm?
491  {
492  *signAlgo = X509_SIGN_ALGO_RSA;
493  *hashAlgo = SHA384_HASH_ALGO;
494  }
495  else
496 #endif
497 #if (X509_SHA512_SUPPORT == ENABLED && SHA512_SUPPORT == ENABLED)
498  //RSA with SHA-512 signature algorithm?
500  {
501  *signAlgo = X509_SIGN_ALGO_RSA;
502  *hashAlgo = SHA512_HASH_ALGO;
503  }
504  else
505 #endif
506 #if (X509_SHA3_224_SUPPORT == ENABLED && SHA3_224_SUPPORT == ENABLED)
507  //RSA with SHA3-224 signature algorithm?
509  {
510  *signAlgo = X509_SIGN_ALGO_RSA;
511  *hashAlgo = SHA3_224_HASH_ALGO;
512  }
513  else
514 #endif
515 #if (X509_SHA3_256_SUPPORT == ENABLED && SHA3_256_SUPPORT == ENABLED)
516  //RSA with SHA3-256 signature algorithm?
518  {
519  *signAlgo = X509_SIGN_ALGO_RSA;
520  *hashAlgo = SHA3_256_HASH_ALGO;
521  }
522  else
523 #endif
524 #if (X509_SHA3_384_SUPPORT == ENABLED && SHA3_384_SUPPORT == ENABLED)
525  //RSA with SHA3-384 signature algorithm?
527  {
528  *signAlgo = X509_SIGN_ALGO_RSA;
529  *hashAlgo = SHA3_384_HASH_ALGO;
530  }
531  else
532 #endif
533 #if (X509_SHA3_512_SUPPORT == ENABLED && SHA3_512_SUPPORT == ENABLED)
534  //RSA with SHA3-512 signature algorithm?
536  {
537  *signAlgo = X509_SIGN_ALGO_RSA;
538  *hashAlgo = SHA3_512_HASH_ALGO;
539  }
540  else
541 #endif
542 #endif
543 #if (X509_RSA_PSS_SUPPORT == ENABLED && RSA_SUPPORT == ENABLED)
544  //RSA-PSS signature algorithm
545  if(OID_COMP(oid, oidLen, RSASSA_PSS_OID) == 0)
546  {
547  //Get the OID of the hash algorithm
548  oid = signAlgoId->rsaPssParams.hashAlgo.value;
549  oidLen = signAlgoId->rsaPssParams.hashAlgo.length;
550 
551 #if (X509_SHA1_SUPPORT == ENABLED && SHA1_SUPPORT == ENABLED)
552  //SHA-1 hash algorithm identifier?
553  if(OID_COMP(oid, oidLen, SHA1_OID) == 0)
554  {
555  //RSA-PSS with SHA-1 signature algorithm
556  *signAlgo = X509_SIGN_ALGO_RSA_PSS;
557  *hashAlgo = SHA1_HASH_ALGO;
558  }
559  else
560 #endif
561 #if (X509_SHA224_SUPPORT == ENABLED && SHA224_SUPPORT == ENABLED)
562  //SHA-224 hash algorithm identifier?
563  if(OID_COMP(oid, oidLen, SHA224_OID) == 0)
564  {
565  //RSA-PSS with SHA-224 signature algorithm
566  *signAlgo = X509_SIGN_ALGO_RSA_PSS;
567  *hashAlgo = SHA224_HASH_ALGO;
568  }
569  else
570 #endif
571 #if (X509_SHA256_SUPPORT == ENABLED && SHA256_SUPPORT == ENABLED)
572  //SHA-256 hash algorithm identifier?
573  if(OID_COMP(oid, oidLen, SHA256_OID) == 0)
574  {
575  //RSA-PSS with SHA-256 signature algorithm
576  *signAlgo = X509_SIGN_ALGO_RSA_PSS;
577  *hashAlgo = SHA256_HASH_ALGO;
578  }
579  else
580 #endif
581 #if (X509_SHA384_SUPPORT == ENABLED && SHA384_SUPPORT == ENABLED)
582  //SHA-384 hash algorithm identifier?
583  if(OID_COMP(oid, oidLen, SHA384_OID) == 0)
584  {
585  //RSA-PSS with SHA-384 signature algorithm
586  *signAlgo = X509_SIGN_ALGO_RSA_PSS;
587  *hashAlgo = SHA384_HASH_ALGO;
588  }
589  else
590 #endif
591 #if (X509_SHA512_SUPPORT == ENABLED && SHA512_SUPPORT == ENABLED)
592  //SHA-512 hash algorithm identifier?
593  if(OID_COMP(oid, oidLen, SHA512_OID) == 0)
594  {
595  //RSA-PSS with SHA-512 signature algorithm
596  *signAlgo = X509_SIGN_ALGO_RSA_PSS;
597  *hashAlgo = SHA512_HASH_ALGO;
598  }
599  else
600 #endif
601 #if (X509_SHA3_224_SUPPORT == ENABLED && SHA3_224_SUPPORT == ENABLED)
602  //SHA3-224 hash algorithm identifier?
603  if(OID_COMP(oid, oidLen, SHA3_224_OID) == 0)
604  {
605  //RSA-PSS with SHA3-224 signature algorithm
606  *signAlgo = X509_SIGN_ALGO_RSA_PSS;
607  *hashAlgo = SHA3_224_HASH_ALGO;
608  }
609  else
610 #endif
611 #if (X509_SHA3_256_SUPPORT == ENABLED && SHA3_256_SUPPORT == ENABLED)
612  //SHA3-256 hash algorithm identifier?
613  if(OID_COMP(oid, oidLen, SHA3_256_OID) == 0)
614  {
615  //RSA-PSS with SHA3-256 signature algorithm
616  *signAlgo = X509_SIGN_ALGO_RSA_PSS;
617  *hashAlgo = SHA3_256_HASH_ALGO;
618  }
619  else
620 #endif
621 #if (X509_SHA3_384_SUPPORT == ENABLED && SHA3_384_SUPPORT == ENABLED)
622  //SHA3-384 hash algorithm identifier?
623  if(OID_COMP(oid, oidLen, SHA3_384_OID) == 0)
624  {
625  //RSA-PSS with SHA3-384 signature algorithm
626  *signAlgo = X509_SIGN_ALGO_RSA_PSS;
627  *hashAlgo = SHA3_384_HASH_ALGO;
628  }
629  else
630 #endif
631 #if (X509_SHA3_512_SUPPORT == ENABLED && SHA3_512_SUPPORT == ENABLED)
632  //SHA3-512 hash algorithm identifier?
633  if(OID_COMP(oid, oidLen, SHA3_512_OID) == 0)
634  {
635  //RSA-PSS with SHA3-512 signature algorithm
636  *signAlgo = X509_SIGN_ALGO_RSA_PSS;
637  *hashAlgo = SHA3_512_HASH_ALGO;
638  }
639  else
640 #endif
641  //Unknown hash algorithm identifier?
642  {
643  //The specified signature algorithm is not supported
645  }
646  }
647  else
648 #endif
649 #if (X509_DSA_SUPPORT == ENABLED && DSA_SUPPORT == ENABLED)
650 #if (X509_SHA1_SUPPORT == ENABLED && SHA1_SUPPORT == ENABLED)
651  //DSA with SHA-1 signature algorithm?
653  {
654  *signAlgo = X509_SIGN_ALGO_DSA;
655  *hashAlgo = SHA1_HASH_ALGO;
656  }
657  else
658 #endif
659 #if (X509_SHA224_SUPPORT == ENABLED && SHA224_SUPPORT == ENABLED)
660  //DSA with SHA-224 signature algorithm?
662  {
663  *signAlgo = X509_SIGN_ALGO_DSA;
664  *hashAlgo = SHA224_HASH_ALGO;
665  }
666  else
667 #endif
668 #if (X509_SHA256_SUPPORT == ENABLED && SHA256_SUPPORT == ENABLED)
669  //DSA with SHA-256 signature algorithm?
671  {
672  *signAlgo = X509_SIGN_ALGO_DSA;
673  *hashAlgo = SHA256_HASH_ALGO;
674  }
675  else
676 #endif
677 #if (X509_SHA384_SUPPORT == ENABLED && SHA384_SUPPORT == ENABLED)
678  //DSA with SHA-384 signature algorithm?
680  {
681  *signAlgo = X509_SIGN_ALGO_DSA;
682  *hashAlgo = SHA384_HASH_ALGO;
683  }
684  else
685 #endif
686 #if (X509_SHA512_SUPPORT == ENABLED && SHA512_SUPPORT == ENABLED)
687  //DSA with SHA-512 signature algorithm?
689  {
690  *signAlgo = X509_SIGN_ALGO_DSA;
691  *hashAlgo = SHA512_HASH_ALGO;
692  }
693  else
694 #endif
695 #if (X509_SHA3_224_SUPPORT == ENABLED && SHA3_224_SUPPORT == ENABLED)
696  //DSA with SHA3-224 signature algorithm?
698  {
699  *signAlgo = X509_SIGN_ALGO_DSA;
700  *hashAlgo = SHA3_224_HASH_ALGO;
701  }
702  else
703 #endif
704 #if (X509_SHA3_256_SUPPORT == ENABLED && SHA3_256_SUPPORT == ENABLED)
705  //DSA with SHA3-256 signature algorithm?
707  {
708  *signAlgo = X509_SIGN_ALGO_DSA;
709  *hashAlgo = SHA3_256_HASH_ALGO;
710  }
711  else
712 #endif
713 #if (X509_SHA3_384_SUPPORT == ENABLED && SHA3_384_SUPPORT == ENABLED)
714  //DSA with SHA3-384 signature algorithm?
716  {
717  *signAlgo = X509_SIGN_ALGO_DSA;
718  *hashAlgo = SHA3_384_HASH_ALGO;
719  }
720  else
721 #endif
722 #if (X509_SHA3_512_SUPPORT == ENABLED && SHA3_512_SUPPORT == ENABLED)
723  //DSA with SHA3-512 signature algorithm?
725  {
726  *signAlgo = X509_SIGN_ALGO_DSA;
727  *hashAlgo = SHA3_512_HASH_ALGO;
728  }
729  else
730 #endif
731 #endif
732 #if (X509_ECDSA_SUPPORT == ENABLED && ECDSA_SUPPORT == ENABLED)
733 #if (X509_SHA1_SUPPORT == ENABLED && SHA1_SUPPORT == ENABLED)
734  //ECDSA with SHA-1 signature algorithm?
736  {
737  *signAlgo = X509_SIGN_ALGO_ECDSA;
738  *hashAlgo = SHA1_HASH_ALGO;
739  }
740  else
741 #endif
742 #if (X509_SHA224_SUPPORT == ENABLED && SHA224_SUPPORT == ENABLED)
743  //ECDSA with SHA-224 signature algorithm?
745  {
746  *signAlgo = X509_SIGN_ALGO_ECDSA;
747  *hashAlgo = SHA224_HASH_ALGO;
748  }
749  else
750 #endif
751 #if (X509_SHA256_SUPPORT == ENABLED && SHA256_SUPPORT == ENABLED)
752  //ECDSA with SHA-256 signature algorithm?
754  {
755  *signAlgo = X509_SIGN_ALGO_ECDSA;
756  *hashAlgo = SHA256_HASH_ALGO;
757  }
758  else
759 #endif
760 #if (X509_SHA384_SUPPORT == ENABLED && SHA384_SUPPORT == ENABLED)
761  //ECDSA with SHA-384 signature algorithm?
763  {
764  *signAlgo = X509_SIGN_ALGO_ECDSA;
765  *hashAlgo = SHA384_HASH_ALGO;
766  }
767  else
768 #endif
769 #if (X509_SHA512_SUPPORT == ENABLED && SHA512_SUPPORT == ENABLED)
770  //ECDSA with SHA-512 signature algorithm?
772  {
773  *signAlgo = X509_SIGN_ALGO_ECDSA;
774  *hashAlgo = SHA512_HASH_ALGO;
775  }
776  else
777 #endif
778 #if (X509_SHA3_224_SUPPORT == ENABLED && SHA3_224_SUPPORT == ENABLED)
779  //ECDSA with SHA3-224 signature algorithm?
781  {
782  *signAlgo = X509_SIGN_ALGO_ECDSA;
783  *hashAlgo = SHA3_224_HASH_ALGO;
784  }
785  else
786 #endif
787 #if (X509_SHA3_256_SUPPORT == ENABLED && SHA3_256_SUPPORT == ENABLED)
788  //ECDSA with SHA3-256 signature algorithm?
790  {
791  *signAlgo = X509_SIGN_ALGO_ECDSA;
792  *hashAlgo = SHA3_256_HASH_ALGO;
793  }
794  else
795 #endif
796 #if (X509_SHA3_384_SUPPORT == ENABLED && SHA3_384_SUPPORT == ENABLED)
797  //ECDSA with SHA3-384 signature algorithm?
799  {
800  *signAlgo = X509_SIGN_ALGO_ECDSA;
801  *hashAlgo = SHA3_384_HASH_ALGO;
802  }
803  else
804 #endif
805 #if (X509_SHA3_512_SUPPORT == ENABLED && SHA3_512_SUPPORT == ENABLED)
806  //ECDSA with SHA3-512 signature algorithm?
808  {
809  *signAlgo = X509_SIGN_ALGO_ECDSA;
810  *hashAlgo = SHA3_512_HASH_ALGO;
811  }
812  else
813 #endif
814 #endif
815 #if (X509_SM2_SUPPORT == ENABLED && SM2_SUPPORT == ENABLED && \
816  X509_SM3_SUPPORT == ENABLED && SM3_SUPPORT == ENABLED)
817  //SM2 with SM3 signature algorithm?
818  if(OID_COMP(oid, oidLen, SM2_WITH_SM3_OID) == 0)
819  {
820  *signAlgo = X509_SIGN_ALGO_SM2;
821  *hashAlgo = SM3_HASH_ALGO;
822  }
823  else
824 #endif
825 #if (X509_ED25519_SUPPORT == ENABLED && ED25519_SUPPORT == ENABLED)
826  //Ed25519 signature algorithm?
827  if(OID_COMP(oid, oidLen, ED25519_OID) == 0)
828  {
829  *signAlgo = X509_SIGN_ALGO_ED25519;
830  *hashAlgo = NULL;
831  }
832  else
833 #endif
834 #if (X509_ED448_SUPPORT == ENABLED && ED448_SUPPORT == ENABLED)
835  //Ed448 signature algorithm?
836  if(OID_COMP(oid, oidLen, ED448_OID) == 0)
837  {
838  *signAlgo = X509_SIGN_ALGO_ED448;
839  *hashAlgo = NULL;
840  }
841  else
842 #endif
843 #if (X509_MLDSA44_SUPPORT == ENABLED && MLDSA44_SUPPORT == ENABLED)
844  //ML-DSA-44 signature algorithm?
845  if(OID_COMP(oid, oidLen, MLDSA44_OID) == 0)
846  {
847  *signAlgo = X509_SIGN_ALGO_MLDSA44;
848  *hashAlgo = NULL;
849  }
850  else
851 #endif
852 #if (X509_MLDSA65_SUPPORT == ENABLED && MLDSA65_SUPPORT == ENABLED)
853  //ML-DSA-65 signature algorithm?
854  if(OID_COMP(oid, oidLen, MLDSA65_OID) == 0)
855  {
856  *signAlgo = X509_SIGN_ALGO_MLDSA65;
857  *hashAlgo = NULL;
858  }
859  else
860 #endif
861 #if (X509_MLDSA87_SUPPORT == ENABLED && MLDSA87_SUPPORT == ENABLED)
862  //ML-DSA-87 signature algorithm?
863  if(OID_COMP(oid, oidLen, MLDSA87_OID) == 0)
864  {
865  *signAlgo = X509_SIGN_ALGO_MLDSA87;
866  *hashAlgo = NULL;
867  }
868  else
869 #endif
870  //Unknown signature algorithm?
871  {
873  }
874 
875  //Return status code
876  return error;
877 }
878 
879 
880 /**
881  * @brief Get the public key type that matches the specified OID
882  * @param[in] oid Object identifier
883  * @param[in] length OID length
884  * @return Public key type
885  **/
886 
888 {
889  X509KeyType keyType;
890 
891  //Invalid parameters?
892  if(oid == NULL || length == 0)
893  {
894  keyType = X509_KEY_TYPE_UNKNOWN;
895  }
896 #if (RSA_SUPPORT == ENABLED)
897  //RSA algorithm identifier?
898  else if(OID_COMP(oid, length, RSA_ENCRYPTION_OID) == 0)
899  {
900  keyType = X509_KEY_TYPE_RSA;
901  }
902  //RSA-PSS algorithm identifier?
903  else if(OID_COMP(oid, length, RSASSA_PSS_OID) == 0)
904  {
905  keyType = X509_KEY_TYPE_RSA_PSS;
906  }
907 #endif
908 #if (DSA_SUPPORT == ENABLED)
909  //DSA algorithm identifier?
910  else if(OID_COMP(oid, length, DSA_OID) == 0)
911  {
912  keyType = X509_KEY_TYPE_DSA;
913  }
914 #endif
915 #if (EC_SUPPORT == ENABLED)
916  //EC public key identifier?
917  else if(OID_COMP(oid, length, EC_PUBLIC_KEY_OID) == 0)
918  {
919  keyType = X509_KEY_TYPE_EC;
920  }
921 #endif
922 #if (X25519_SUPPORT == ENABLED)
923  //X25519 algorithm identifier?
924  else if(OID_COMP(oid, length, X25519_OID) == 0)
925  {
926  keyType = X509_KEY_TYPE_X25519;
927  }
928 #endif
929 #if (ED25519_SUPPORT == ENABLED)
930  //Ed25519 algorithm identifier?
931  else if(OID_COMP(oid, length, ED25519_OID) == 0)
932  {
933  keyType = X509_KEY_TYPE_ED25519;
934  }
935 #endif
936 #if (X448_SUPPORT == ENABLED)
937  //X448 algorithm identifier?
938  else if(OID_COMP(oid, length, X448_OID) == 0)
939  {
940  keyType = X509_KEY_TYPE_X448;
941  }
942 #endif
943 #if (ED448_SUPPORT == ENABLED)
944  //Ed448 algorithm identifier?
945  else if(OID_COMP(oid, length, ED448_OID) == 0)
946  {
947  keyType = X509_KEY_TYPE_ED448;
948  }
949 #endif
950 #if (MLDSA44_SUPPORT == ENABLED)
951  //ML-DSA-44 algorithm identifier?
952  else if(OID_COMP(oid, length, MLDSA44_OID) == 0)
953  {
954  keyType = X509_KEY_TYPE_MLDSA44;
955  }
956 #endif
957 #if (MLDSA65_SUPPORT == ENABLED)
958  //ML-DSA-65 algorithm identifier?
959  else if(OID_COMP(oid, length, MLDSA65_OID) == 0)
960  {
961  keyType = X509_KEY_TYPE_MLDSA65;
962  }
963 #endif
964 #if (MLDSA87_SUPPORT == ENABLED)
965  //ML-DSA-87 algorithm identifier?
966  else if(OID_COMP(oid, length, MLDSA87_OID) == 0)
967  {
968  keyType = X509_KEY_TYPE_MLDSA87;
969  }
970 #endif
971  //Unknown algorithm identifier?
972  else
973  {
974  keyType = X509_KEY_TYPE_UNKNOWN;
975  }
976 
977  //Return public key type
978  return keyType;
979 }
980 
981 
982 /**
983  * @brief Get the elliptic curve that matches the specified OID
984  * @param[in] oid Object identifier
985  * @param[in] length Length of the OID, in bytes
986  * @return Elliptic curve parameters
987  **/
988 
989 const EcCurve *x509GetCurve(const uint8_t *oid, size_t length)
990 {
991  const EcCurve *curve;
992 
993  //Default elliptic curve parameters
994  curve = NULL;
995 
996 #if (X509_ECDSA_SUPPORT == ENABLED && ECDSA_SUPPORT == ENABLED)
997  //Invalid parameters?
998  if(oid == NULL || length == 0)
999  {
1000  curve = NULL;
1001  }
1002 #if (X509_SECP112R1_SUPPORT == ENABLED)
1003  //secp112r1 elliptic curve?
1004  else if(OID_COMP(oid, length, SECP112R1_OID) == 0)
1005  {
1006  curve = ecGetCurve(oid, length);
1007  }
1008 #endif
1009 #if (X509_SECP112R2_SUPPORT == ENABLED)
1010  //secp112r2 elliptic curve?
1011  else if(OID_COMP(oid, length, SECP112R2_OID) == 0)
1012  {
1013  curve = ecGetCurve(oid, length);
1014  }
1015 #endif
1016 #if (X509_SECP128R1_SUPPORT == ENABLED)
1017  //secp128r1 elliptic curve?
1018  else if(OID_COMP(oid, length, SECP128R1_OID) == 0)
1019  {
1020  curve = ecGetCurve(oid, length);
1021  }
1022 #endif
1023 #if (X509_SECP128R2_SUPPORT == ENABLED)
1024  //secp128r2 elliptic curve?
1025  else if(OID_COMP(oid, length, SECP128R2_OID) == 0)
1026  {
1027  curve = ecGetCurve(oid, length);
1028  }
1029 #endif
1030 #if (X509_SECP160K1_SUPPORT == ENABLED)
1031  //secp160k1 elliptic curve?
1032  else if(OID_COMP(oid, length, SECP160K1_OID) == 0)
1033  {
1034  curve = ecGetCurve(oid, length);
1035  }
1036 #endif
1037 #if (X509_SECP160R1_SUPPORT == ENABLED)
1038  //secp160r1 elliptic curve?
1039  else if(OID_COMP(oid, length, SECP160R1_OID) == 0)
1040  {
1041  curve = ecGetCurve(oid, length);
1042  }
1043 #endif
1044 #if (X509_SECP160R2_SUPPORT == ENABLED)
1045  //secp160r2 elliptic curve?
1046  else if(OID_COMP(oid, length, SECP160R2_OID) == 0)
1047  {
1048  curve = ecGetCurve(oid, length);
1049  }
1050 #endif
1051 #if (X509_SECP192K1_SUPPORT == ENABLED)
1052  //secp192k1 elliptic curve?
1053  else if(OID_COMP(oid, length, SECP192K1_OID) == 0)
1054  {
1055  curve = ecGetCurve(oid, length);
1056  }
1057 #endif
1058 #if (X509_SECP192R1_SUPPORT == ENABLED)
1059  //secp192r1 elliptic curve?
1060  else if(OID_COMP(oid, length, SECP192R1_OID) == 0)
1061  {
1062  curve = ecGetCurve(oid, length);
1063  }
1064 #endif
1065 #if (X509_SECP224K1_SUPPORT == ENABLED)
1066  //secp224k1 elliptic curve?
1067  else if(OID_COMP(oid, length, SECP224K1_OID) == 0)
1068  {
1069  curve = ecGetCurve(oid, length);
1070  }
1071 #endif
1072 #if (X509_SECP224R1_SUPPORT == ENABLED)
1073  //secp224r1 elliptic curve?
1074  else if(OID_COMP(oid, length, SECP224R1_OID) == 0)
1075  {
1076  curve = ecGetCurve(oid, length);
1077  }
1078 #endif
1079 #if (X509_SECP256K1_SUPPORT == ENABLED)
1080  //secp256k1 elliptic curve?
1081  else if(OID_COMP(oid, length, SECP256K1_OID) == 0)
1082  {
1083  curve = ecGetCurve(oid, length);
1084  }
1085 #endif
1086 #if (X509_SECP256R1_SUPPORT == ENABLED)
1087  //secp256r1 elliptic curve?
1088  else if(OID_COMP(oid, length, SECP256R1_OID) == 0)
1089  {
1090  curve = ecGetCurve(oid, length);
1091  }
1092 #endif
1093 #if (X509_SECP384R1_SUPPORT == ENABLED)
1094  //secp384r1 elliptic curve?
1095  else if(OID_COMP(oid, length, SECP384R1_OID) == 0)
1096  {
1097  curve = ecGetCurve(oid, length);
1098  }
1099 #endif
1100 #if (X509_SECP521R1_SUPPORT == ENABLED)
1101  //secp521r1 elliptic curve?
1102  else if(OID_COMP(oid, length, SECP521R1_OID) == 0)
1103  {
1104  curve = ecGetCurve(oid, length);
1105  }
1106 #endif
1107 #if (X509_BRAINPOOLP160R1_SUPPORT == ENABLED)
1108  //brainpoolP160r1 elliptic curve?
1109  else if(OID_COMP(oid, length, BRAINPOOLP160R1_OID) == 0)
1110  {
1111  curve = ecGetCurve(oid, length);
1112  }
1113 #endif
1114 #if (X509_BRAINPOOLP160T1_SUPPORT == ENABLED)
1115  //brainpoolP160t1 elliptic curve?
1116  else if(OID_COMP(oid, length, BRAINPOOLP160T1_OID) == 0)
1117  {
1118  curve = ecGetCurve(oid, length);
1119  }
1120 #endif
1121 #if (X509_BRAINPOOLP192R1_SUPPORT == ENABLED)
1122  //brainpoolP192r1 elliptic curve?
1123  else if(OID_COMP(oid, length, BRAINPOOLP192R1_OID) == 0)
1124  {
1125  curve = ecGetCurve(oid, length);
1126  }
1127 #endif
1128 #if (X509_BRAINPOOLP192T1_SUPPORT == ENABLED)
1129  //brainpoolP192t1 elliptic curve?
1130  else if(OID_COMP(oid, length, BRAINPOOLP192T1_OID) == 0)
1131  {
1132  curve = ecGetCurve(oid, length);
1133  }
1134 #endif
1135 #if (X509_BRAINPOOLP224R1_SUPPORT == ENABLED)
1136  //brainpoolP224r1 elliptic curve?
1137  else if(OID_COMP(oid, length, BRAINPOOLP224R1_OID) == 0)
1138  {
1139  curve = ecGetCurve(oid, length);
1140  }
1141 #endif
1142 #if (X509_BRAINPOOLP224T1_SUPPORT == ENABLED)
1143  //brainpoolP224t1 elliptic curve?
1144  else if(OID_COMP(oid, length, BRAINPOOLP224T1_OID) == 0)
1145  {
1146  curve = ecGetCurve(oid, length);
1147  }
1148 #endif
1149 #if (X509_BRAINPOOLP256R1_SUPPORT == ENABLED)
1150  //brainpoolP256r1 elliptic curve?
1151  else if(OID_COMP(oid, length, BRAINPOOLP256R1_OID) == 0)
1152  {
1153  curve = ecGetCurve(oid, length);
1154  }
1155 #endif
1156 #if (X509_BRAINPOOLP256T1_SUPPORT == ENABLED)
1157  //brainpoolP256t1 elliptic curve?
1158  else if(OID_COMP(oid, length, BRAINPOOLP256T1_OID) == 0)
1159  {
1160  curve = ecGetCurve(oid, length);
1161  }
1162 #endif
1163 #if (X509_BRAINPOOLP320R1_SUPPORT == ENABLED)
1164  //brainpoolP320r1 elliptic curve?
1165  else if(OID_COMP(oid, length, BRAINPOOLP320R1_OID) == 0)
1166  {
1167  curve = ecGetCurve(oid, length);
1168  }
1169 #endif
1170 #if (X509_BRAINPOOLP320T1_SUPPORT == ENABLED)
1171  //brainpoolP320t1 elliptic curve?
1172  else if(OID_COMP(oid, length, BRAINPOOLP320T1_OID) == 0)
1173  {
1174  curve = ecGetCurve(oid, length);
1175  }
1176 #endif
1177 #if (X509_BRAINPOOLP384R1_SUPPORT == ENABLED)
1178  //brainpoolP384r1 elliptic curve?
1179  else if(OID_COMP(oid, length, BRAINPOOLP384R1_OID) == 0)
1180  {
1181  curve = ecGetCurve(oid, length);
1182  }
1183 #endif
1184 #if (X509_BRAINPOOLP384T1_SUPPORT == ENABLED)
1185  //brainpoolP384t1 elliptic curve?
1186  else if(OID_COMP(oid, length, BRAINPOOLP384T1_OID) == 0)
1187  {
1188  curve = ecGetCurve(oid, length);
1189  }
1190 #endif
1191 #if (X509_BRAINPOOLP512R1_SUPPORT == ENABLED)
1192  //brainpoolP512r1 elliptic curve?
1193  else if(OID_COMP(oid, length, BRAINPOOLP512R1_OID) == 0)
1194  {
1195  curve = ecGetCurve(oid, length);
1196  }
1197 #endif
1198 #if (X509_BRAINPOOLP512T1_SUPPORT == ENABLED)
1199  //brainpoolP512t1 elliptic curve?
1200  else if(OID_COMP(oid, length, BRAINPOOLP512T1_OID) == 0)
1201  {
1202  curve = ecGetCurve(oid, length);
1203  }
1204 #endif
1205 #if (X509_FRP256V1_SUPPORT == ENABLED)
1206  //FRP256v1 elliptic curve?
1207  else if(OID_COMP(oid, length, FRP256V1_OID) == 0)
1208  {
1209  curve = ecGetCurve(oid, length);
1210  }
1211 #endif
1212 #if (X509_SM2_SUPPORT == ENABLED)
1213  //SM2 elliptic curve?
1214  else if(OID_COMP(oid, length, SM2_OID) == 0)
1215  {
1216  curve = ecGetCurve(oid, length);
1217  }
1218 #endif
1219 #if (X509_ED25519_SUPPORT == ENABLED)
1220  //Ed25519 elliptic curve?
1221  else if(OID_COMP(oid, length, ED25519_OID) == 0)
1222  {
1223  curve = ecGetCurve(oid, length);
1224  }
1225 #endif
1226 #if (X509_ED448_SUPPORT == ENABLED)
1227  //Ed448 elliptic curve?
1228  else if(OID_COMP(oid, length, ED448_OID) == 0)
1229  {
1230  curve = ecGetCurve(oid, length);
1231  }
1232 #endif
1233  //Unknown elliptic curve?
1234  else
1235  {
1236  curve = NULL;
1237  }
1238 #endif
1239 
1240  //Return the elliptic curve parameters, if any
1241  return curve;
1242 }
1243 
1244 #endif
const uint8_t X509_POLICY_MAPPINGS_OID[3]
Definition: x509_common.c:109
const uint8_t MLDSA44_OID[9]
Definition: mldsa.c:47
bool_t x509IsCurveSupported(const uint8_t *oid, size_t length)
Check whether a given elliptic curve is supported.
Definition: x509_common.c:410
#define SHA3_512_HASH_ALGO
Definition: sha3_512.h:45
X.509 common definitions.
@ X509_KEY_TYPE_RSA
Definition: x509_common.h:659
const uint8_t X509_DOMAIN_COMPONENT_OID[10]
Definition: x509_common.c:76
const uint8_t X509_CERTIFICATE_POLICIES_OID[3]
Definition: x509_common.c:107
const uint8_t RSASSA_PKCS1_V1_5_WITH_SHA3_512_OID[9]
Definition: rsa.c:82
#define SHA256_HASH_ALGO
Definition: sha256.h:49
int bool_t
Definition: compiler_port.h:63
const uint8_t X509_KP_DOC_SIGNING_OID[8]
Definition: x509_common.c:158
#define SHA1_HASH_ALGO
Definition: sha1.h:49
const uint8_t X509_KP_SERVER_AUTH_OID[8]
Definition: x509_common.c:130
const uint8_t SHA3_384_OID[9]
Definition: sha3_384.c:47
const uint8_t DSA_WITH_SHA224_OID[9]
Definition: dsa.c:55
bool_t x509IsSignAlgoSupported(X509SignatureAlgo signAlgo)
Check whether a given signature algorithm is supported.
Definition: x509_common.c:210
bool_t x509IsHashAlgoSupported(X509HashAlgo hashAlgo)
Check whether a given hash algorithm is supported.
Definition: x509_common.c:306
const uint8_t X509_ISSUER_ALT_NAME_OID[3]
Definition: x509_common.c:87
#define SHA512_HASH_ALGO
Definition: sha512.h:49
@ X509_SIGN_ALGO_MLDSA65
Definition: x509_common.h:689
const uint8_t X25519_OID[3]
Definition: ec_curves.c:108
const uint8_t MD5_WITH_RSA_ENCRYPTION_OID[9]
Definition: rsa.c:59
const uint8_t X509_SUBJECT_ALT_NAME_OID[3]
Definition: x509_common.c:85
const uint8_t SHA512_WITH_RSA_ENCRYPTION_OID[9]
Definition: rsa.c:69
@ X509_KEY_TYPE_X448
Definition: x509_common.h:666
const uint8_t MLDSA65_OID[9]
Definition: mldsa.c:49
const uint8_t X509_ORGANIZATION_NAME_OID[3]
Definition: x509_common.c:58
const uint8_t RSASSA_PKCS1_V1_5_WITH_SHA3_384_OID[9]
Definition: rsa.c:80
X509OctetString hashAlgo
Definition: x509_common.h:1121
const uint8_t X509_KP_CODE_SIGNING_OID[8]
Definition: x509_common.c:134
@ X509_KEY_TYPE_MLDSA87
Definition: x509_common.h:670
OID (Object Identifier)
#define TRUE
Definition: os_port.h:50
const uint8_t RSASSA_PKCS1_V1_5_WITH_SHA3_224_OID[9]
Definition: rsa.c:76
const uint8_t BRAINPOOLP512T1_OID[9]
Definition: ec_curves.c:102
const uint8_t ECDSA_WITH_SHA3_512_OID[9]
Definition: ecdsa.c:62
const uint8_t EC_PUBLIC_KEY_OID[7]
Definition: ec.c:44
const uint8_t X509_EXTENDED_KEY_USAGE_OID[3]
Definition: x509_common.c:115
const uint8_t X509_ANY_EXT_KEY_USAGE_OID[4]
Definition: x509_common.c:128
const uint8_t SECP224R1_OID[5]
Definition: ec_curves.c:66
const uint8_t BRAINPOOLP512R1_OID[9]
Definition: ec_curves.c:100
const uint8_t X509_INVALIDITY_DATE_OID[3]
Definition: x509_common.c:95
const uint8_t BRAINPOOLP224T1_OID[9]
Definition: ec_curves.c:86
const uint8_t SECP160K1_OID[5]
Definition: ec_curves.c:54
const uint8_t X509_POLICY_CONSTRAINTS_OID[3]
Definition: x509_common.c:113
const uint8_t SECP256K1_OID[5]
Definition: ec_curves.c:68
const uint8_t ECDSA_WITH_SHA3_256_OID[9]
Definition: ecdsa.c:58
#define osMemcmp(p1, p2, length)
Definition: os_port.h:159
const uint8_t X509_KEY_USAGE_OID[3]
Definition: x509_common.c:83
const uint8_t X509_KP_TIME_STAMPING_OID[8]
Definition: x509_common.c:144
#define SM3_HASH_ALGO
Definition: sm3.h:49
const uint8_t BRAINPOOLP384R1_OID[9]
Definition: ec_curves.c:96
const uint8_t PKCS9_CHALLENGE_PASSWORD_OID[9]
Definition: x509_common.c:168
const uint8_t X509_ISSUING_DISTR_POINT_OID[3]
Definition: x509_common.c:99
const uint8_t X509_NAME_CONSTRAINTS_OID[3]
Definition: x509_common.c:103
const uint8_t RSASSA_PSS_OID[9]
Definition: rsa.c:85
const uint8_t X509_KP_OCSP_SIGNING_OID[8]
Definition: x509_common.c:146
const uint8_t X509_COUNTRY_NAME_OID[3]
Definition: x509_common.c:52
const uint8_t ECDSA_WITH_SHA256_OID[8]
Definition: ecdsa.c:50
const uint8_t BRAINPOOLP320R1_OID[9]
Definition: ec_curves.c:92
const uint8_t SECP256R1_OID[8]
Definition: ec_curves.c:70
uint8_t oid[]
Definition: lldp_tlv.h:300
const uint8_t X509_INHIBIT_ANY_POLICY_OID[3]
Definition: x509_common.c:119
const uint8_t DSA_WITH_SHA3_512_OID[9]
Definition: dsa.c:69
const uint8_t X509_PSEUDONYM_OID[3]
Definition: x509_common.c:74
const uint8_t SECP224K1_OID[5]
Definition: ec_curves.c:64
const uint8_t BRAINPOOLP256T1_OID[9]
Definition: ec_curves.c:90
Certificate parsing options.
Definition: x509_common.h:1379
@ X509_SIGN_ALGO_MLDSA44
Definition: x509_common.h:688
const uint8_t X509_DELTA_CRL_INDICATOR_OID[3]
Definition: x509_common.c:97
const uint8_t DSA_OID[7]
Definition: dsa.c:51
const uint8_t X509_BASIC_CONSTRAINTS_OID[3]
Definition: x509_common.c:89
const uint8_t RSASSA_PKCS1_V1_5_WITH_SHA3_256_OID[9]
Definition: rsa.c:78
#define SHA3_224_HASH_ALGO
Definition: sha3_224.h:45
const uint8_t X509_TITLE_OID[3]
Definition: x509_common.c:62
const uint8_t SHA384_WITH_RSA_ENCRYPTION_OID[9]
Definition: rsa.c:67
const uint8_t SECP112R1_OID[5]
Definition: ec_curves.c:46
const uint8_t SECP521R1_OID[5]
Definition: ec_curves.c:74
@ X509_KEY_TYPE_EC
Definition: x509_common.h:662
#define FALSE
Definition: os_port.h:46
X509SignatureAlgo
Signature algorithms.
Definition: x509_common.h:679
const uint8_t X509_AUTH_INFO_ACCESS_OID[8]
Definition: x509_common.c:121
const uint8_t BRAINPOOLP160R1_OID[9]
Definition: ec_curves.c:76
const X509Options X509_DEFAULT_OPTIONS
Definition: x509_common.c:173
const EcCurve * x509GetCurve(const uint8_t *oid, size_t length)
Get the elliptic curve that matches the specified OID.
Definition: x509_common.c:989
error_t
Error codes.
Definition: error.h:43
const uint8_t DSA_WITH_SHA3_256_OID[9]
Definition: dsa.c:65
const uint8_t X509_INITIALS_OID[3]
Definition: x509_common.c:68
const uint8_t DSA_WITH_SHA384_OID[9]
Definition: dsa.c:59
const uint8_t X509_DN_QUALIFIER_OID[3]
Definition: x509_common.c:72
const uint8_t X509_SUBJECT_DIR_ATTR_OID[3]
Definition: x509_common.c:79
@ X509_SIGN_ALGO_ECDSA
Definition: x509_common.h:684
@ X509_HASH_ALGO_NONE
Definition: x509_common.h:700
const uint8_t SHA256_OID[9]
Definition: sha256.c:82
const uint8_t X509_LOCALITY_NAME_OID[3]
Definition: x509_common.c:54
const uint8_t BRAINPOOLP192T1_OID[9]
Definition: ec_curves.c:82
#define MD5_HASH_ALGO
Definition: md5.h:49
const uint8_t X509_REASON_CODE_OID[3]
Definition: x509_common.c:93
const uint8_t X509_KP_EMAIL_PROTECTION_OID[8]
Definition: x509_common.c:136
const uint8_t X509_SERIAL_NUMBER_OID[3]
Definition: x509_common.c:50
const uint8_t ECDSA_WITH_SHA384_OID[8]
Definition: ecdsa.c:52
const uint8_t X509_AUTHORITY_KEY_ID_OID[3]
Definition: x509_common.c:111
@ X509_HASH_ALGO_SHA1
Definition: x509_common.h:702
const uint8_t SHA3_512_OID[9]
Definition: sha3_512.c:47
const uint8_t DSA_WITH_SHA512_OID[9]
Definition: dsa.c:61
const uint8_t X509_COMMON_NAME_OID[3]
Definition: x509_common.c:46
General definitions for cryptographic algorithms.
error_t x509GetSignHashAlgo(const X509SignAlgoId *signAlgoId, X509SignatureAlgo *signAlgo, const HashAlgo **hashAlgo)
Get the signature and hash algorithms that match the specified identifier.
Definition: x509_common.c:433
const uint8_t X509_KP_IPSEC_USER_OID[8]
Definition: x509_common.c:142
const uint8_t SHA3_224_OID[9]
Definition: sha3_224.c:47
@ X509_HASH_ALGO_SHA3_224
Definition: x509_common.h:707
const uint8_t SECP128R2_OID[5]
Definition: ec_curves.c:52
const uint8_t SECP160R1_OID[5]
Definition: ec_curves.c:56
const uint8_t X509_PKIX_OCSP_NO_CHECK_OID[9]
Definition: x509_common.c:123
@ X509_KEY_TYPE_RSA_PSS
Definition: x509_common.h:660
const uint8_t X509_AD_OCSP[8]
Definition: x509_common.c:163
const uint8_t X509_KP_IPSEC_IKE_OID[8]
Definition: x509_common.c:148
@ X509_HASH_ALGO_SHA224
Definition: x509_common.h:703
@ X509_SIGN_ALGO_MLDSA87
Definition: x509_common.h:690
uint8_t length
Definition: tcp.h:375
const uint8_t X509_CRL_NUMBER_OID[3]
Definition: x509_common.c:91
const uint8_t SM2_WITH_SM3_OID[8]
Definition: sm2.c:45
X509OctetString oid
Definition: x509_common.h:1134
const uint8_t X509_CERTIFICATE_ISSUER_OID[3]
Definition: x509_common.c:101
const uint8_t ECDSA_WITH_SHA3_224_OID[9]
Definition: ecdsa.c:56
X509HashAlgo
Hash algorithms.
Definition: x509_common.h:699
const uint8_t X509_KP_CLIENT_AUTH_OID[8]
Definition: x509_common.c:132
const uint8_t ECDSA_WITH_SHA1_OID[7]
Definition: ecdsa.c:46
const uint8_t ECDSA_WITH_SHA224_OID[8]
Definition: ecdsa.c:48
@ X509_SIGN_ALGO_RSA
Definition: x509_common.h:681
const uint8_t X509_CRL_DISTR_POINTS_OID[3]
Definition: x509_common.c:105
const uint8_t SHA256_WITH_RSA_ENCRYPTION_OID[9]
Definition: rsa.c:65
const uint8_t PKCS9_EMAIL_ADDR_OID[9]
Definition: x509_common.c:166
const uint8_t SECP192R1_OID[8]
Definition: ec_curves.c:62
const uint8_t ED448_OID[3]
Definition: ec_curves.c:114
const uint8_t ECDSA_WITH_SHA512_OID[8]
Definition: ecdsa.c:54
const uint8_t SECP384R1_OID[5]
Definition: ec_curves.c:72
Collection of hash algorithms.
const uint8_t ED25519_OID[3]
Definition: ec_curves.c:112
const uint8_t RSA_ENCRYPTION_OID[9]
Definition: rsa.c:54
const uint8_t X448_OID[3]
Definition: ec_curves.c:110
const uint8_t DSA_WITH_SHA3_384_OID[9]
Definition: dsa.c:67
@ X509_HASH_ALGO_SHA3_512
Definition: x509_common.h:710
#define SHA384_HASH_ALGO
Definition: sha384.h:45
const uint8_t BRAINPOOLP384T1_OID[9]
Definition: ec_curves.c:98
const uint8_t SECP192K1_OID[5]
Definition: ec_curves.c:60
const uint8_t X509_KP_SSH_SERVER_OID[8]
Definition: x509_common.c:152
const uint8_t DSA_WITH_SHA3_224_OID[9]
Definition: dsa.c:63
@ X509_HASH_ALGO_MD5
Definition: x509_common.h:701
const uint8_t BRAINPOOLP160T1_OID[9]
Definition: ec_curves.c:78
#define SHA3_256_HASH_ALGO
Definition: sha3_256.h:45
const uint8_t X509_FRESHEST_CRL_OID[3]
Definition: x509_common.c:117
const uint8_t SECP112R2_OID[5]
Definition: ec_curves.c:48
@ X509_SIGN_ALGO_RSA_PSS
Definition: x509_common.h:682
@ X509_KEY_TYPE_ED448
Definition: x509_common.h:667
@ X509_HASH_ALGO_SHA3_256
Definition: x509_common.h:708
@ X509_HASH_ALGO_SHA3_384
Definition: x509_common.h:709
const uint8_t BRAINPOOLP320T1_OID[9]
Definition: ec_curves.c:94
const uint8_t X509_NAME_OID[3]
Definition: x509_common.c:64
const uint8_t SHA3_256_OID[9]
Definition: sha3_256.c:47
#define OID_COMP(oid1, oidLen1, oid2)
Definition: oid.h:42
const uint8_t X509_AD_CA_ISSUERS[8]
Definition: x509_common.c:161
const uint8_t ECDSA_WITH_SHA3_384_OID[9]
Definition: ecdsa.c:60
@ X509_HASH_ALGO_SHA512
Definition: x509_common.h:706
@ X509_KEY_TYPE_MLDSA44
Definition: x509_common.h:668
const uint8_t X509_NS_CERT_TYPE_OID[9]
Definition: x509_common.c:125
@ X509_KEY_TYPE_DSA
Definition: x509_common.h:661
const uint8_t BRAINPOOLP224R1_OID[9]
Definition: ec_curves.c:84
const uint8_t FRP256V1_OID[10]
Definition: ec_curves.c:104
const uint8_t DSA_WITH_SHA1_OID[7]
Definition: dsa.c:53
const uint8_t DSA_WITH_SHA256_OID[9]
Definition: dsa.c:57
const uint8_t X509_GENERATION_QUALIFIER_OID[3]
Definition: x509_common.c:70
uint8_t oidLen
Definition: lldp_tlv.h:299
@ X509_HASH_ALGO_SHA384
Definition: x509_common.h:705
@ X509_HASH_ALGO_SHA256
Definition: x509_common.h:704
const uint8_t BRAINPOOLP192R1_OID[9]
Definition: ec_curves.c:80
const uint8_t SHA512_OID[9]
Definition: sha512.c:99
const uint8_t X509_KP_IPSEC_TUNNEL_OID[8]
Definition: x509_common.c:140
const uint8_t X509_KP_CMC_RA_OID[8]
Definition: x509_common.c:156
const uint8_t X509_ORGANIZATIONAL_UNIT_NAME_OID[3]
Definition: x509_common.c:60
const EcCurve * ecGetCurve(const uint8_t *oid, size_t length)
Get the elliptic curve that matches the specified OID.
Definition: ec_curves.c:5888
const uint8_t SECP160R2_OID[5]
Definition: ec_curves.c:58
const uint8_t X509_SURNAME_OID[3]
Definition: x509_common.c:48
const uint8_t SHA1_OID[5]
Definition: sha1.c:73
#define SHA224_HASH_ALGO
Definition: sha224.h:45
const uint8_t SHA224_WITH_RSA_ENCRYPTION_OID[9]
Definition: rsa.c:63
const uint8_t X509_GIVEN_NAME_OID[3]
Definition: x509_common.c:66
const uint8_t X509_SUBJECT_KEY_ID_OID[3]
Definition: x509_common.c:81
const uint8_t * value
Definition: x509_common.h:732
Common interface for hash algorithms.
Definition: crypto.h:1165
@ X509_KEY_TYPE_UNKNOWN
Definition: x509_common.h:658
#define EcCurve
Definition: ec.h:346
const uint8_t SHA224_OID[9]
Definition: sha224.c:47
const uint8_t X509_KP_IPSEC_END_SYSTEM_OID[8]
Definition: x509_common.c:138
bool_t x509CompareName(const uint8_t *name1, size_t nameLen1, const uint8_t *name2, size_t nameLen2)
Compare distinguished names.
Definition: x509_common.c:188
@ ERROR_UNSUPPORTED_SIGNATURE_ALGO
Definition: error.h:132
@ X509_SIGN_ALGO_SM2
Definition: x509_common.h:685
@ X509_SIGN_ALGO_ED25519
Definition: x509_common.h:686
const uint8_t MLDSA87_OID[9]
Definition: mldsa.c:51
@ X509_KEY_TYPE_ED25519
Definition: x509_common.h:665
X509KeyType
Public Key types.
Definition: x509_common.h:657
@ X509_SIGN_ALGO_NONE
Definition: x509_common.h:680
X509KeyType x509GetPublicKeyType(const uint8_t *oid, size_t length)
Get the public key type that matches the specified OID.
Definition: x509_common.c:887
const uint8_t SHA384_OID[9]
Definition: sha384.c:47
@ X509_HASH_ALGO_SM3
Definition: x509_common.h:711
@ X509_KEY_TYPE_MLDSA65
Definition: x509_common.h:669
X509RsaPssParameters rsaPssParams
Definition: x509_common.h:1136
const uint8_t X509_STATE_OR_PROVINCE_NAME_OID[]
Definition: x509_common.c:56
const uint8_t X509_KP_CMC_CA_OID[8]
Definition: x509_common.c:154
const uint8_t SHA1_WITH_RSA_ENCRYPTION_OID[9]
Definition: rsa.c:61
const uint8_t PKCS9_EXTENSION_REQUEST_OID[9]
Definition: x509_common.c:170
#define SHA3_384_HASH_ALGO
Definition: sha3_384.h:45
Signature algorithm identifier.
Definition: x509_common.h:1133
@ NO_ERROR
Success.
Definition: error.h:44
const uint8_t SECP128R1_OID[5]
Definition: ec_curves.c:50
Debugging facilities.
@ X509_KEY_TYPE_X25519
Definition: x509_common.h:664
ASN.1 (Abstract Syntax Notation One)
@ X509_SIGN_ALGO_DSA
Definition: x509_common.h:683
@ X509_SIGN_ALGO_ED448
Definition: x509_common.h:687
const uint8_t BRAINPOOLP256R1_OID[9]
Definition: ec_curves.c:88
const uint8_t X509_KP_SSH_CLIENT_OID[8]
Definition: x509_common.c:150
const uint8_t SM2_OID[8]
Definition: ec_curves.c:106