1 /*
2 * Copyright (C) 2022 Huawei Technologies Co., Ltd.
3 * Licensed under the Mulan PSL v2.
4 * You can use this software according to the terms and conditions of the Mulan PSL v2.
5 * You may obtain a copy of Mulan PSL v2 at:
6 * http://license.coscl.org.cn/MulanPSL2
7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
9 * PURPOSE.
10 * See the Mulan PSL v2 for more details.
11 */
12 #include <string.h>
13 #include <tee_log.h>
14 #include "crypto_wrapper.h"
15 #include "crypto_inner_interface.h"
16
x509_crl_validate(uint8_t * cert,uint32_t cert_len,uint8_t * parent_key,uint32_t parent_key_len)17 int x509_crl_validate(uint8_t *cert, uint32_t cert_len, uint8_t *parent_key, uint32_t parent_key_len)
18 {
19 (void)cert;
20 (void)cert_len;
21 (void)parent_key;
22 (void)parent_key_len;
23 tloge("mix system do not support x509 crl validate\n");
24 return -1;
25 }
26
x509_cert_validate(uint8_t * cert,uint32_t cert_len,uint8_t * parent_key,uint32_t parent_key_len)27 int x509_cert_validate(uint8_t *cert, uint32_t cert_len, uint8_t *parent_key, uint32_t parent_key_len)
28 {
29 (void)cert;
30 (void)cert_len;
31 (void)parent_key;
32 (void)parent_key_len;
33 tloge("mix system do not support x509 cert validate\n");
34 return -1;
35 }
36
get_keytype_from_sp(const uint8_t * in,uint32_t inlen)37 int get_keytype_from_sp(const uint8_t *in, uint32_t inlen)
38 {
39 (void)in;
40 (void)inlen;
41 tloge("mix system do not support get keytype from sp\n");
42 return -1;
43 }
44
import_pub_from_sp(void * pub,const uint8_t * in,uint32_t inlen)45 int import_pub_from_sp(void *pub, const uint8_t *in, uint32_t inlen)
46 {
47 (void)pub;
48 (void)in;
49 (void)inlen;
50 tloge("mix system do not support import pub from sp\n");
51 return -1;
52 }
53
get_subject_public_key(uint8_t * pub,const uint8_t * cert,uint32_t cert_len)54 int32_t get_subject_public_key(uint8_t *pub, const uint8_t *cert, uint32_t cert_len)
55 {
56 (void)pub;
57 (void)cert;
58 (void)cert_len;
59 tloge("mix system do not support get subject public key\n");
60 return -1;
61 }
62
get_validity_from_cert(validity_period_t * vd,uint8_t * cert,uint32_t cert_len)63 int get_validity_from_cert(validity_period_t *vd, uint8_t *cert, uint32_t cert_len)
64 {
65 (void)vd;
66 (void)cert;
67 (void)cert_len;
68 tloge("mix system do not support get validity from cert\n");
69 return -1;
70 }
71
get_subject_CN(uint8_t * name,uint32_t name_size,const uint8_t * cert,uint32_t cert_len)72 int32_t get_subject_CN(uint8_t *name, uint32_t name_size, const uint8_t *cert, uint32_t cert_len)
73 {
74 (void)name;
75 (void)name_size;
76 (void)cert;
77 (void)cert_len;
78 tloge("mix system do not support get subject CN\n");
79 return -1;
80 }
81
get_subject_x509_cn(uint8_t * name,uint32_t name_size,const uint8_t * cert,uint32_t cert_len)82 int32_t get_subject_x509_cn(uint8_t *name, uint32_t name_size, const uint8_t *cert, uint32_t cert_len)
83 {
84 (void)name;
85 (void)name_size;
86 (void)cert;
87 (void)cert_len;
88 tloge("mix system do not support get subject CN\n");
89 return -1;
90 }
91
get_subject_OU(uint8_t * name,uint32_t name_size,const uint8_t * cert,uint32_t cert_len)92 int32_t get_subject_OU(uint8_t *name, uint32_t name_size, const uint8_t *cert, uint32_t cert_len)
93 {
94 (void)name;
95 (void)name_size;
96 (void)cert;
97 (void)cert_len;
98 tloge("mix system do not support get subject OU\n");
99 return -1;
100 }
101
get_subject_x509_ou(uint8_t * name,uint32_t name_size,const uint8_t * cert,uint32_t cert_len)102 int32_t get_subject_x509_ou(uint8_t *name, uint32_t name_size, const uint8_t *cert, uint32_t cert_len)
103 {
104 (void)name;
105 (void)name_size;
106 (void)cert;
107 (void)cert_len;
108 tloge("mix system do not support get subject OU\n");
109 return -1;
110 }
111
get_serial_number_from_cert(uint8_t * serial_number,uint32_t serial_number_size,uint8_t * cert,uint32_t cert_len)112 int get_serial_number_from_cert(uint8_t *serial_number, uint32_t serial_number_size, uint8_t *cert, uint32_t cert_len)
113 {
114 (void)serial_number;
115 (void)serial_number_size;
116 (void)cert;
117 (void)cert_len;
118 tloge("mix system do not support get serial number from cert\n");
119 return -1;
120 }
121
get_issuer_from_cert(uint8_t * issuer,uint32_t issuer_size,uint8_t * crl,uint32_t crl_len)122 int get_issuer_from_cert(uint8_t *issuer, uint32_t issuer_size, uint8_t *crl, uint32_t crl_len)
123 {
124 (void)issuer;
125 (void)issuer_size;
126 (void)crl;
127 (void)crl_len;
128 tloge("mix system do not support get issuer from cert\n");
129 return -1;
130 }
131
get_subject_public_key_new(uint8_t * pub,uint32_t pub_size,const uint8_t * cert,uint32_t cert_len)132 int32_t get_subject_public_key_new(uint8_t *pub, uint32_t pub_size, const uint8_t *cert, uint32_t cert_len)
133 {
134 (void)pub;
135 (void)pub_size;
136 (void)cert;
137 (void)cert_len;
138 tloge("mix system do not support get subject public key new\n");
139 return -1;
140 }
141