Home
last modified time | relevance | path

Searched refs:pk (Results 1 – 25 of 37) sorted by relevance

12

/mbedtls-development/tests/suites/
A Dtest_suite_pk.function2 #include "mbedtls/pk.h"
34 ((void) pk);
137 mbedtls_pk_init( &pk );
145 mbedtls_pk_free( &pk );
146 mbedtls_pk_init( &pk );
187 mbedtls_pk_free( &pk );
208 mbedtls_pk_context pk;
213 mbedtls_pk_init( &pk );
295 mbedtls_pk_context pk;
325 mbedtls_pk_context pk;
[all …]
A Dtest_suite_pkparse.function2 #include "mbedtls/pk.h"
121 mbedtls_pk_context pk;
123 mbedtls_pk_init( &pk );
125 TEST_ASSERT( mbedtls_pk_parse_key( &pk, buf->x, buf->len, NULL, 0,
129 mbedtls_pk_free( &pk );
A Dtest_suite_pkwrite.function2 #include "mbedtls/pk.h"
A Dtest_suite_ecdsa.function311 void ecdsa_read_restart( int id, data_t *pk, data_t *hash, data_t *sig,
323 pk->x, pk->len ) == 0 );
/mbedtls-development/programs/fuzz/
A Dfuzz_privkey.c15 mbedtls_pk_context pk; in LLVMFuzzerTestOneInput() local
22 mbedtls_pk_init( &pk ); in LLVMFuzzerTestOneInput()
23 ret = mbedtls_pk_parse_key( &pk, Data, Size, NULL, 0, in LLVMFuzzerTestOneInput()
27 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_RSA ) in LLVMFuzzerTestOneInput()
36 rsa = mbedtls_pk_rsa( pk ); in LLVMFuzzerTestOneInput()
51 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY || in LLVMFuzzerTestOneInput()
52 mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY_DH ) in LLVMFuzzerTestOneInput()
54 mbedtls_ecp_keypair *ecp = mbedtls_pk_ec( pk ); in LLVMFuzzerTestOneInput()
72 mbedtls_pk_free( &pk ); in LLVMFuzzerTestOneInput()
A Dfuzz_pubkey.c10 mbedtls_pk_context pk; in LLVMFuzzerTestOneInput() local
12 mbedtls_pk_init( &pk ); in LLVMFuzzerTestOneInput()
13 ret = mbedtls_pk_parse_public_key( &pk, Data, Size ); in LLVMFuzzerTestOneInput()
16 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_RSA ) in LLVMFuzzerTestOneInput()
25 rsa = mbedtls_pk_rsa( pk ); in LLVMFuzzerTestOneInput()
44 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY || in LLVMFuzzerTestOneInput()
45 mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY_DH ) in LLVMFuzzerTestOneInput()
47 mbedtls_ecp_keypair *ecp = mbedtls_pk_ec( pk ); in LLVMFuzzerTestOneInput()
70 mbedtls_pk_free( &pk ); in LLVMFuzzerTestOneInput()
/mbedtls-development/programs/pkey/
A Drsa_verify_pss.c63 mbedtls_pk_context pk; in main() local
68 mbedtls_pk_init( &pk ); in main()
84 if( ( ret = mbedtls_pk_parse_public_keyfile( &pk, argv[1] ) ) != 0 ) in main()
91 if( !mbedtls_pk_can_do( &pk, MBEDTLS_PK_RSA ) ) in main()
97 if( ( ret = mbedtls_rsa_set_padding( mbedtls_pk_rsa( pk ), in main()
135 if( ( ret = mbedtls_pk_verify( &pk, MBEDTLS_MD_SHA256, hash, 0, in main()
147 mbedtls_pk_free( &pk ); in main()
A Dkey_app.c100 mbedtls_pk_context pk; in main() local
109 mbedtls_pk_init( &pk ); in main()
216 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_RSA ) in main()
218 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( pk ); in main()
239 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY ) in main()
241 mbedtls_ecp_keypair *ecp = mbedtls_pk_ec( pk ); in main()
274 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_RSA ) in main()
276 mbedtls_rsa_context *rsa = mbedtls_pk_rsa( pk ); in main()
290 if( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY ) in main()
292 mbedtls_ecp_keypair *ecp = mbedtls_pk_ec( pk ); in main()
[all …]
A Drsa_sign_pss.c63 mbedtls_pk_context pk; in main() local
73 mbedtls_pk_init( &pk ); in main()
101 if( ( ret = mbedtls_pk_parse_keyfile( &pk, argv[1], "", in main()
109 if( !mbedtls_pk_can_do( &pk, MBEDTLS_PK_RSA ) ) in main()
115 if( ( ret = mbedtls_rsa_set_padding( mbedtls_pk_rsa( pk ), in main()
138 if( ( ret = mbedtls_pk_sign( &pk, MBEDTLS_MD_SHA256, hash, 0, in main()
171 mbedtls_pk_free( &pk ); in main()
A Dpk_verify.c60 mbedtls_pk_context pk; in main() local
65 mbedtls_pk_init( &pk ); in main()
81 if( ( ret = mbedtls_pk_parse_public_keyfile( &pk, argv[1] ) ) != 0 ) in main()
117 if( ( ret = mbedtls_pk_verify( &pk, MBEDTLS_MD_SHA256, hash, 0, in main()
129 mbedtls_pk_free( &pk ); in main()
A Dpk_decrypt.c65 mbedtls_pk_context pk; in main() local
73 mbedtls_pk_init( &pk ); in main()
105 if( ( ret = mbedtls_pk_parse_keyfile( &pk, argv[1], "", in main()
137 if( ( ret = mbedtls_pk_decrypt( &pk, buf, i, result, &olen, sizeof(result), in main()
153 mbedtls_pk_free( &pk ); in main()
A Dpk_encrypt.c65 mbedtls_pk_context pk; in main() local
74 mbedtls_pk_init( &pk ); in main()
102 if( ( ret = mbedtls_pk_parse_public_keyfile( &pk, argv[1] ) ) != 0 ) in main()
122 if( ( ret = mbedtls_pk_encrypt( &pk, input, strlen( argv[2] ), in main()
156 mbedtls_pk_free( &pk ); in main()
A Dpk_sign.c62 mbedtls_pk_context pk; in main() local
73 mbedtls_pk_init( &pk ); in main()
100 if( ( ret = mbedtls_pk_parse_keyfile( &pk, argv[1], "", in main()
122 if( ( ret = mbedtls_pk_sign( &pk, MBEDTLS_MD_SHA256, hash, 0, in main()
155 mbedtls_pk_free( &pk ); in main()
/mbedtls-development/library/
A Dpkparse.c623 PK_VALIDATE_RET( pk != NULL ); in mbedtls_pk_parse_subpubkey()
670 mbedtls_pk_free( pk ); in mbedtls_pk_parse_subpubkey()
1001 mbedtls_pk_context *pk, in pk_parse_key_pkcs8_unencrypted_der() argument
1103 mbedtls_pk_context *pk, in pk_parse_key_pkcs8_encrypted_der() argument
1364 mbedtls_pk_free( pk ); in mbedtls_pk_parse_key()
1365 mbedtls_pk_init( pk ); in mbedtls_pk_parse_key()
1379 mbedtls_pk_free( pk ); in mbedtls_pk_parse_key()
1380 mbedtls_pk_init( pk ); in mbedtls_pk_parse_key()
1391 mbedtls_pk_free( pk ); in mbedtls_pk_parse_key()
1392 mbedtls_pk_init( pk ); in mbedtls_pk_parse_key()
[all …]
A Dpk.c600 int mbedtls_pk_wrap_as_opaque( mbedtls_pk_context *pk, in mbedtls_pk_wrap_as_opaque() argument
605 ((void) pk); in mbedtls_pk_wrap_as_opaque()
620 if( mbedtls_pk_get_type( pk ) != MBEDTLS_PK_ECKEY ) in mbedtls_pk_wrap_as_opaque()
623 ec = mbedtls_pk_ec( *pk ); in mbedtls_pk_wrap_as_opaque()
642 mbedtls_pk_free( pk ); in mbedtls_pk_wrap_as_opaque()
643 mbedtls_pk_init( pk ); in mbedtls_pk_wrap_as_opaque()
645 return( mbedtls_pk_setup_opaque( pk, *key ) ); in mbedtls_pk_wrap_as_opaque()
A Dx509_csr.c193 if( ( ret = mbedtls_pk_parse_subpubkey( &p, end, &csr->pk ) ) != 0 ) in mbedtls_x509_csr_parse_der()
360 mbedtls_pk_get_name( &csr->pk ) ) ) != 0 ) in mbedtls_x509_csr_info()
366 (int) mbedtls_pk_get_bitlen( &csr->pk ) ); in mbedtls_x509_csr_info()
392 mbedtls_pk_free( &csr->pk ); in mbedtls_x509_csr_free()
A Decdsa.c264 mbedtls_mpi *pk = &k, *pr = r; in ecdsa_sign_restartable() local
285 pk = &rs_ctx->sig->k; in ecdsa_sign_restartable()
318 MBEDTLS_MPI_CHK( mbedtls_ecp_gen_privkey( grp, pk, f_rng, p_rng ) ); in ecdsa_sign_restartable()
326 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, &R, pk, &grp->G, in ecdsa_sign_restartable()
364 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( pk, pk, &t ) ); in ecdsa_sign_restartable()
365 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( pk, pk, &grp->N ) ); in ecdsa_sign_restartable()
366 MBEDTLS_MPI_CHK( mbedtls_mpi_inv_mod( s, pk, &grp->N ) ); in ecdsa_sign_restartable()
A Dpsa_crypto_rsa.c203 mbedtls_pk_context pk; in mbedtls_psa_rsa_export_key() local
206 mbedtls_pk_init( &pk ); in mbedtls_psa_rsa_export_key()
207 pk.pk_info = &mbedtls_rsa_info; in mbedtls_psa_rsa_export_key()
208 pk.pk_ctx = rsa; in mbedtls_psa_rsa_export_key()
214 ret = mbedtls_pk_write_key_der( &pk, data, data_size ); in mbedtls_psa_rsa_export_key()
216 ret = mbedtls_pk_write_pubkey( &pos, data, &pk ); in mbedtls_psa_rsa_export_key()
A Dssl_tls13_generic.c381 if( !mbedtls_pk_can_do( &ssl->session_negotiate->peer_cert->pk, sig_alg ) ) in ssl_tls13_parse_certificate_verify()
430 &ssl->session_negotiate->peer_cert->pk, in ssl_tls13_parse_certificate_verify()
736 const mbedtls_pk_context *pk = &ssl->session_negotiate->peer_cert->pk; in ssl_tls13_validate_certificate() local
739 if( mbedtls_pk_can_do( pk, MBEDTLS_PK_ECKEY ) && in ssl_tls13_validate_certificate()
740 mbedtls_ssl_check_curve( ssl, mbedtls_pk_ec( *pk )->grp.id ) != 0 ) in ssl_tls13_validate_certificate()
A Dx509_crt.c217 const mbedtls_pk_context *pk ) in x509_profile_check_key() argument
219 const mbedtls_pk_type_t pk_alg = mbedtls_pk_get_type( pk ); in x509_profile_check_key()
224 if( mbedtls_pk_get_bitlen( pk ) >= profile->rsa_min_bitlen ) in x509_profile_check_key()
2381 if( x509_profile_check_key( profile, &ca->pk ) != 0 ) in x509_crt_verifycrl()
2454 if( ! mbedtls_pk_can_do( &parent->pk, child->sig_pk ) ) in x509_crt_check_signature()
2460 return( mbedtls_pk_verify_restartable( &parent->pk, in x509_crt_check_signature()
3133 pk_type = mbedtls_pk_get_type( &crt->pk ); in x509_crt_verify_restartable_ca_cb()
3138 if( x509_profile_check_key( profile, &crt->pk ) != 0 ) in x509_crt_verify_restartable_ca_cb()
3282 mbedtls_pk_free( &cert_cur->pk ); in mbedtls_x509_crt_free()
3365 mbedtls_pk_restart_init( &ctx->pk ); in mbedtls_x509_crt_restart_init()
[all …]
A Ddebug.c278 const char *text, const mbedtls_pk_context *pk ) in debug_print_pk() argument
286 if( mbedtls_pk_debug( pk, items ) != 0 ) in debug_print_pk()
365 debug_print_pk( ssl, level, file, line, "crt->", &crt->pk ); in mbedtls_debug_print_crt()
/mbedtls-development/include/mbedtls/
A Dpk.h226 static inline mbedtls_rsa_context *mbedtls_pk_rsa( const mbedtls_pk_context pk ) in mbedtls_pk_rsa() argument
228 return( (mbedtls_rsa_context *) (pk).MBEDTLS_PRIVATE(pk_ctx) ); in mbedtls_pk_rsa()
239 static inline mbedtls_ecp_keypair *mbedtls_pk_ec( const mbedtls_pk_context pk ) in mbedtls_pk_ec() argument
241 return( (mbedtls_ecp_keypair *) (pk).MBEDTLS_PRIVATE(pk_ctx) ); in mbedtls_pk_ec()
853 mbedtls_pk_context *pk );
900 int mbedtls_pk_wrap_as_opaque( mbedtls_pk_context *pk,
A Dx509_csr.h60 mbedtls_pk_context pk; /**< Container for the public key context. */ member
A Dx509_crt.h74 mbedtls_pk_context pk; /**< Container for the public key context. */ member
334 mbedtls_pk_restart_ctx MBEDTLS_PRIVATE(pk);
/mbedtls-development/programs/ssl/
A Dssl_server2.c988 mbedtls_pk_context *pk; /*!< Private key */ member
1012 mbedtls_pk_context *pk, in ssl_async_set_key() argument
1019 ctx->slots[ctx->slots_used].pk = pk; in ssl_async_set_key()
1078 if( mbedtls_pk_check_pair( &cert->pk, in ssl_async_start()
1162 ret = mbedtls_pk_decrypt( key_slot->pk, in ssl_async_resume()
1168 ret = mbedtls_pk_sign( key_slot->pk, in ssl_async_resume()
2798 mbedtls_pk_context *pk = &pkey; in main() local
2810 pk = NULL; in main()
2821 mbedtls_pk_context *pk = &pkey2; in main() local
2833 pk = NULL; in main()
[all …]

Completed in 39 milliseconds

12