Lines Matching refs:MBEDTLS_PRIVATE
52 if (!xtime || !xtime->MBEDTLS_PRIVATE(year) || xtime->MBEDTLS_PRIVATE(year) < 0) in lws_tls_mbedtls_time_to_unix()
57 t.tm_year = xtime->MBEDTLS_PRIVATE(year) - 1900; in lws_tls_mbedtls_time_to_unix()
58 t.tm_mon = xtime->MBEDTLS_PRIVATE(mon) - 1; /* mbedtls months are 1+, tm are 0+ */ in lws_tls_mbedtls_time_to_unix()
59 t.tm_mday = xtime->MBEDTLS_PRIVATE(day) - 1; /* mbedtls days are 1+, tm are 0+ */ in lws_tls_mbedtls_time_to_unix()
60 t.tm_hour = xtime->MBEDTLS_PRIVATE(hour); in lws_tls_mbedtls_time_to_unix()
61 t.tm_min = xtime->MBEDTLS_PRIVATE(min); in lws_tls_mbedtls_time_to_unix()
62 t.tm_sec = xtime->MBEDTLS_PRIVATE(sec); in lws_tls_mbedtls_time_to_unix()
84 (const char *)name->MBEDTLS_PRIVATE(val).MBEDTLS_PRIVATE(p), in lws_tls_mbedtls_get_x509_name()
85 name->MBEDTLS_PRIVATE(val).MBEDTLS_PRIVATE(len), in lws_tls_mbedtls_get_x509_name()
90 name = name->MBEDTLS_PRIVATE(next); in lws_tls_mbedtls_get_x509_name()
112 buf->time = lws_tls_mbedtls_time_to_unix(&x509->MBEDTLS_PRIVATE(valid_from)); in lws_tls_mbedtls_cert_info()
118 buf->time = lws_tls_mbedtls_time_to_unix(&x509->MBEDTLS_PRIVATE(valid_to)); in lws_tls_mbedtls_cert_info()
124 return lws_tls_mbedtls_get_x509_name(&x509->MBEDTLS_PRIVATE(subject), buf, len); in lws_tls_mbedtls_cert_info()
127 return lws_tls_mbedtls_get_x509_name(&x509->MBEDTLS_PRIVATE(issuer), buf, len); in lws_tls_mbedtls_cert_info()
130 buf->usage = x509->MBEDTLS_PRIVATE(key_usage); in lws_tls_mbedtls_cert_info()
138 switch (mbedtls_pk_get_type(&x509->MBEDTLS_PRIVATE(pk))) { in lws_tls_mbedtls_cert_info()
141 mbedtls_rsa_context *rsa = mbedtls_pk_rsa(x509->MBEDTLS_PRIVATE(pk)); in lws_tls_mbedtls_cert_info()
143 if (mbedtls_mpi_write_string(&rsa->MBEDTLS_PRIVATE(N), 16, p, r, &u)) in lws_tls_mbedtls_cert_info()
147 if (mbedtls_mpi_write_string(&rsa->MBEDTLS_PRIVATE(E), 16, p, r, &u)) in lws_tls_mbedtls_cert_info()
156 mbedtls_ecp_keypair *ecp = mbedtls_pk_ec(x509->MBEDTLS_PRIVATE(pk)); in lws_tls_mbedtls_cert_info()
158 if (mbedtls_mpi_write_string(&ecp->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(X), 16, p, r, &u)) in lws_tls_mbedtls_cert_info()
162 if (mbedtls_mpi_write_string(&ecp->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(Y), 16, p, r, &u)) in lws_tls_mbedtls_cert_info()
166 if (mbedtls_mpi_write_string(&ecp->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(Z), 16, p, r, &u)) in lws_tls_mbedtls_cert_info()
175 mbedtls_pk_get_type(&x509->MBEDTLS_PRIVATE(pk))); in lws_tls_mbedtls_cert_info()
183 buf->ns.len = (int)x509->MBEDTLS_PRIVATE(raw).MBEDTLS_PRIVATE(len); in lws_tls_mbedtls_cert_info()
185 if (len < x509->MBEDTLS_PRIVATE(raw).MBEDTLS_PRIVATE(len)) in lws_tls_mbedtls_cert_info()
192 memcpy(buf->ns.name, x509->MBEDTLS_PRIVATE(raw).MBEDTLS_PRIVATE(p), in lws_tls_mbedtls_cert_info()
193 x509->MBEDTLS_PRIVATE(raw).MBEDTLS_PRIVATE(len)); in lws_tls_mbedtls_cert_info()
202 if (akid.keyIdentifier.MBEDTLS_PRIVATE(tag) != MBEDTLS_ASN1_OCTET_STRING) in lws_tls_mbedtls_cert_info()
204 buf->ns.len = (int)akid.keyIdentifier.MBEDTLS_PRIVATE(len); in lws_tls_mbedtls_cert_info()
205 if (!akid.keyIdentifier.MBEDTLS_PRIVATE(p) || in lws_tls_mbedtls_cert_info()
208 memcpy(buf->ns.name, akid.keyIdentifier.MBEDTLS_PRIVATE(p), (size_t)buf->ns.len); in lws_tls_mbedtls_cert_info()
224 if (akid.keyIdentifier.MBEDTLS_PRIVATE(tag) != MBEDTLS_ASN1_OCTET_STRING || in lws_tls_mbedtls_cert_info()
225 !ip->MBEDTLS_PRIVATE(buf).MBEDTLS_PRIVATE(p) || in lws_tls_mbedtls_cert_info()
226 ip->MBEDTLS_PRIVATE(buf).MBEDTLS_PRIVATE(len) < 9 || in lws_tls_mbedtls_cert_info()
227 len < (size_t)ip->MBEDTLS_PRIVATE(buf).MBEDTLS_PRIVATE(len) - 9u) in lws_tls_mbedtls_cert_info()
230 memcpy(buf->ns.name + buf->ns.len, ip->MBEDTLS_PRIVATE(buf).MBEDTLS_PRIVATE(p), in lws_tls_mbedtls_cert_info()
231 (size_t)ip->MBEDTLS_PRIVATE(buf).MBEDTLS_PRIVATE(len) - 9); in lws_tls_mbedtls_cert_info()
232 buf->ns.len = buf->ns.len + (int)ip->MBEDTLS_PRIVATE(buf).MBEDTLS_PRIVATE(len) - 9; in lws_tls_mbedtls_cert_info()
234 ip = ip->MBEDTLS_PRIVATE(next); in lws_tls_mbedtls_cert_info()
245 if (akid.authorityCertSerialNumber.MBEDTLS_PRIVATE(tag) != MBEDTLS_ASN1_OCTET_STRING) in lws_tls_mbedtls_cert_info()
247 buf->ns.len = (int)akid.authorityCertSerialNumber.MBEDTLS_PRIVATE(len); in lws_tls_mbedtls_cert_info()
248 if (!akid.authorityCertSerialNumber.MBEDTLS_PRIVATE(p) || in lws_tls_mbedtls_cert_info()
252 MBEDTLS_PRIVATE(p), (size_t)buf->ns.len); in lws_tls_mbedtls_cert_info()
262 if (skid.MBEDTLS_PRIVATE(tag) != MBEDTLS_ASN1_OCTET_STRING) in lws_tls_mbedtls_cert_info()
264 buf->ns.len = (int)skid.MBEDTLS_PRIVATE(len); in lws_tls_mbedtls_cert_info()
267 memcpy(buf->ns.name, skid.MBEDTLS_PRIVATE(p), (size_t)buf->ns.len); in lws_tls_mbedtls_cert_info()
382 int kt = (int)mbedtls_pk_get_type(&x509->cert.MBEDTLS_PRIVATE(pk)), in lws_x509_public_to_jwk()
394 rsactx = mbedtls_pk_rsa(x509->cert.MBEDTLS_PRIVATE(pk)); in lws_x509_public_to_jwk()
396 mpi[LWS_GENCRYPTO_RSA_KEYEL_E] = &rsactx->MBEDTLS_PRIVATE(E); in lws_x509_public_to_jwk()
397 mpi[LWS_GENCRYPTO_RSA_KEYEL_N] = &rsactx->MBEDTLS_PRIVATE(N); in lws_x509_public_to_jwk()
398 mpi[LWS_GENCRYPTO_RSA_KEYEL_D] = &rsactx->MBEDTLS_PRIVATE(D); in lws_x509_public_to_jwk()
399 mpi[LWS_GENCRYPTO_RSA_KEYEL_P] = &rsactx->MBEDTLS_PRIVATE(P); in lws_x509_public_to_jwk()
400 mpi[LWS_GENCRYPTO_RSA_KEYEL_Q] = &rsactx->MBEDTLS_PRIVATE(Q); in lws_x509_public_to_jwk()
401 mpi[LWS_GENCRYPTO_RSA_KEYEL_DP] = &rsactx->MBEDTLS_PRIVATE(DP); in lws_x509_public_to_jwk()
402 mpi[LWS_GENCRYPTO_RSA_KEYEL_DQ] = &rsactx->MBEDTLS_PRIVATE(DQ); in lws_x509_public_to_jwk()
403 mpi[LWS_GENCRYPTO_RSA_KEYEL_QI] = &rsactx->MBEDTLS_PRIVATE(QP); in lws_x509_public_to_jwk()
412 ecpctx = mbedtls_pk_ec(x509->cert.MBEDTLS_PRIVATE(pk)); in lws_x509_public_to_jwk()
413 mpi[LWS_GENCRYPTO_EC_KEYEL_X] = &ecpctx->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(X); in lws_x509_public_to_jwk()
414 mpi[LWS_GENCRYPTO_EC_KEYEL_D] = &ecpctx->MBEDTLS_PRIVATE(d); in lws_x509_public_to_jwk()
415 mpi[LWS_GENCRYPTO_EC_KEYEL_Y] = &ecpctx->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(Y); in lws_x509_public_to_jwk()
418 (int)ecpctx->MBEDTLS_PRIVATE(grp).id, jwk)) in lws_x509_public_to_jwk()
486 mpi[LWS_GENCRYPTO_RSA_KEYEL_D] = &rsactx->MBEDTLS_PRIVATE(D); in lws_x509_jwk_privkey_pem()
487 mpi[LWS_GENCRYPTO_RSA_KEYEL_P] = &rsactx->MBEDTLS_PRIVATE(P); in lws_x509_jwk_privkey_pem()
488 mpi[LWS_GENCRYPTO_RSA_KEYEL_Q] = &rsactx->MBEDTLS_PRIVATE(Q); in lws_x509_jwk_privkey_pem()
498 mpi[LWS_GENCRYPTO_EC_KEYEL_D] = &ecpctx->MBEDTLS_PRIVATE(d); in lws_x509_jwk_privkey_pem()