Lines Matching refs:ret
64 int ret = 1; in main() local
98 if ((ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, in main()
101 mbedtls_printf(" failed\n ! mbedtls_ctr_drbg_seed returned %d\n", ret); in main()
119 if ((ret = mbedtls_mpi_read_file(&N, 16, f)) != 0 || in main()
120 (ret = mbedtls_mpi_read_file(&E, 16, f)) != 0 || in main()
121 (ret = mbedtls_mpi_read_file(&D, 16, f)) != 0 || in main()
122 (ret = mbedtls_mpi_read_file(&P, 16, f)) != 0 || in main()
123 (ret = mbedtls_mpi_read_file(&Q, 16, f)) != 0) { in main()
125 ret); in main()
131 if ((ret = mbedtls_rsa_import(&rsa, &N, &P, &Q, &D, &E)) != 0) { in main()
133 ret); in main()
137 if ((ret = mbedtls_rsa_complete(&rsa)) != 0) { in main()
139 ret); in main()
170 if ((ret = mbedtls_net_bind(&listen_fd, NULL, SERVER_PORT, MBEDTLS_NET_PROTO_TCP)) != 0) { in main()
171 mbedtls_printf(" failed\n ! mbedtls_net_bind returned %d\n\n", ret); in main()
175 if ((ret = mbedtls_net_accept(&listen_fd, &client_fd, in main()
177 mbedtls_printf(" failed\n ! mbedtls_net_accept returned %d\n\n", ret); in main()
189 if ((ret = in main()
192 mbedtls_printf(" failed\n ! mbedtls_dhm_make_params returned %d\n\n", ret); in main()
199 if ((ret = mbedtls_sha1(buf, n, hash)) != 0) { in main()
200 mbedtls_printf(" failed\n ! mbedtls_sha1 returned %d\n\n", ret); in main()
207 if ((ret = mbedtls_rsa_pkcs1_sign(&rsa, NULL, NULL, MBEDTLS_MD_SHA256, in main()
209 mbedtls_printf(" failed\n ! mbedtls_rsa_pkcs1_sign returned %d\n\n", ret); in main()
217 if ((ret = mbedtls_net_send(&client_fd, buf2, 2)) != 2 || in main()
218 (ret = mbedtls_net_send(&client_fd, buf, buflen)) != (int) buflen) { in main()
219 mbedtls_printf(" failed\n ! mbedtls_net_send returned %d\n\n", ret); in main()
232 if ((ret = mbedtls_net_recv(&client_fd, buf, n)) != (int) n) { in main()
233 mbedtls_printf(" failed\n ! mbedtls_net_recv returned %d\n\n", ret); in main()
237 if ((ret = mbedtls_dhm_read_public(&dhm, buf, n)) != 0) { in main()
238 mbedtls_printf(" failed\n ! mbedtls_dhm_read_public returned %d\n\n", ret); in main()
248 if ((ret = mbedtls_dhm_calc_secret(&dhm, buf, sizeof(buf), &n, in main()
250 mbedtls_printf(" failed\n ! mbedtls_dhm_calc_secret returned %d\n\n", ret); in main()
269 ret = mbedtls_aes_setkey_enc(&aes, buf, 256); in main()
270 if (ret != 0) { in main()
274 ret = mbedtls_aes_crypt_ecb(&aes, MBEDTLS_AES_ENCRYPT, buf, buf); in main()
275 if (ret != 0) { in main()
279 if ((ret = mbedtls_net_send(&client_fd, buf, 16)) != 16) { in main()
280 mbedtls_printf(" failed\n ! mbedtls_net_send returned %d\n\n", ret); in main()