File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,8 @@ int x509_decode_subject_public_key_info(const unsigned char *in, unsigned long i
303303 unsigned int algorithm , void * public_key , unsigned long * public_key_len ,
304304 ltc_asn1_type parameters_type , ltc_asn1_list * parameters , unsigned long * parameters_len );
305305
306+ int pk_oid_cmp_with_asn1 (const char * o1 , const ltc_asn1_list * o2 );
307+
306308#endif /* LTC_DER */
307309
308310/* tomcrypt_pkcs.h */
Original file line number Diff line number Diff line change 1+ /* LibTomCrypt, modular cryptographic library -- Tom St Denis
2+ *
3+ * LibTomCrypt is a library that provides various cryptographic
4+ * algorithms in a highly modular and flexible manner.
5+ *
6+ * The library is free for all purposes without any express
7+ * guarantee it works.
8+ */
9+ #include "tomcrypt_private.h"
10+
11+ #ifdef LTC_DER
12+
13+ /*
14+ Compare an OID string to an OID element decoded from ASN.1.
15+ @return CRYPT_OK if equal
16+ */
17+ int pk_oid_cmp_with_asn1 (const char * o1 , const ltc_asn1_list * o2 )
18+ {
19+ unsigned long i ;
20+ char tmp [256 ] = { 0 };
21+ int err ;
22+
23+ if (o1 == NULL || o2 == NULL ) return CRYPT_ERROR ;
24+
25+ if (o2 -> type != LTC_ASN1_OBJECT_IDENTIFIER ) return CRYPT_INVALID_ARG ;
26+
27+ i = sizeof (tmp );
28+ if ((err = pk_oid_num_to_str (o2 -> data , o2 -> size , tmp , & i )) != CRYPT_OK ) {
29+ return err ;
30+ }
31+
32+ if (XSTRCMP (o1 , tmp ) != 0 ) {
33+ return CRYPT_PK_INVALID_TYPE ;
34+ }
35+
36+ return CRYPT_OK ;
37+ }
38+
39+ #endif
40+
41+ /* ref: $Format:%D$ */
42+ /* git commit: $Format:%H$ */
43+ /* commit time: $Format:%ai$ */
You can’t perform that action at this time.
0 commit comments