Lines Matching refs:error

107 	const char *error = NULL;
111 if (!dcrypt_ctx_sym_create("aes-128-gcm", DCRYPT_MODE_ENCRYPT, &ctx, &error)) {
136 test_assert(dcrypt_ctx_sym_init(ctx, &error));
137 test_assert(dcrypt_ctx_sym_update(ctx, pt->data, pt->used, res, &error));
138 test_assert(dcrypt_ctx_sym_final(ctx, res, &error));
146 if (!dcrypt_ctx_sym_create("aes-128-gcm", DCRYPT_MODE_DECRYPT, &ctx, &error)) {
156 test_assert(dcrypt_ctx_sym_init(ctx, &error));
157 test_assert(dcrypt_ctx_sym_update(ctx, ct->data, ct->used, res, &error));
158 test_assert(dcrypt_ctx_sym_final(ctx, res, &error));
203 const char *error = NULL;
215 &key_hash, &error);
218 test_assert(error == NULL);
228 error = NULL;
234 &key_hash, &error);
237 test_assert(error == NULL);
248 error = NULL;
254 &key_hash, &error);
256 test_assert(error == NULL);
268 error = NULL;
270 ret = dcrypt_key_load_private(&pkey2, data3, NULL, NULL, &error);
272 test_assert(error == NULL);
274 ret = dcrypt_key_load_private(&pkey, data1, NULL, pkey2, &error);
276 test_assert(error == NULL);
292 const char *error = NULL;
294 test_assert(dcrypt_key_load_private(&pkey, "1\t716\t0\t048FD04FD3612B22D32790C592CF21CEF417EFD2EA34AE5F688FA5B51BED29E05A308B68DA78E16E90B47A11E133BD9A208A2894FD01B0BEE865CE339EA3FB17AC\td0cfaca5d335f9edc41c84bb47465184cb0e2ec3931bebfcea4dd433615e77a0", NULL, NULL, &error));
302 dcrypt_key_id_public(pubkey, "sha256", key_1, &error);
308 test_assert(dcrypt_key_load_private(&pkey2, "1\t716\t1\t0567e6bf9579813ae967314423b0fceb14bda24749303923de9a9bb9370e0026f995901a57e63113eeb2baf0c940e978d00686cbb52bd5014bc318563375876255\t0300E46DA2125427BE968EB3B649910CDC4C405E5FFDE18D433A97CABFEE28CEEFAE9EE356C792004FFB80981D67E741B8CC036A34235A8D2E1F98D1658CFC963D07EB\td0cfaca5d335f9edc41c84bb47465184cb0e2ec3931bebfcea4dd433615e77a0\t7c9a1039ea2e4fed73e81dd3ffc3fa22ea4a28352939adde7bf8ea858b00fa4f", NULL, pkey, &error));
316 test_assert(dcrypt_key_id_public_old(pubkey, key_1, &error));
335 const char* error = NULL;
346 &key_hash, &error);
349 test_assert(error == NULL);
358 ret = dcrypt_key_load_public(&pub_key, data1, &error);
360 test_assert(error == NULL);
385 const char *error = NULL;
390 test_assert_idx(dcrypt_key_load_private(&priv2, keys[0], NULL, NULL, &error), 0);
391 test_assert_idx(dcrypt_key_store_private(priv2, DCRYPT_FORMAT_PEM, NULL, tmp, NULL, NULL, &error), 0);
395 test_assert_idx(dcrypt_key_load_private(&priv, keys[1], NULL, NULL, &error), 1);
396 test_assert_idx(dcrypt_key_store_private(priv, DCRYPT_FORMAT_DOVECOT, NULL, tmp, NULL, NULL, &error), 1);
401 test_assert_idx(dcrypt_key_load_private(&priv, keys[2], "This Is Sparta", NULL, &error), 2);
402 test_assert_idx(dcrypt_key_store_private(priv, DCRYPT_FORMAT_DOVECOT, "aes-256-ctr", tmp, "This Is Sparta", NULL, &error), 2);
408 test_assert_idx(dcrypt_key_load_private(&priv, keys[3], NULL, priv2, &error), 3);
409 test_assert_idx(dcrypt_key_store_private(priv, DCRYPT_FORMAT_DOVECOT, "ecdh-aes-256-ctr", tmp, NULL, pub, &error), 3);
417 if (error != NULL) error = NULL;
426 const char *error;
431 test_assert(dcrypt_key_load_public(&pub, key, &error));
436 test_assert(dcrypt_key_store_public(pub, DCRYPT_FORMAT_DOVECOT, tmp, &error));
456 const char *error = NULL;
460 &key_hash, &error));
461 test_assert(error == NULL);
479 const char *error = NULL;
496 &error);
501 &key_hash, &error);
514 buf, NULL, NULL, &error);
520 &key_hash, &error);
559 const char *error = NULL;
562 NULL, NULL, NULL, NULL, &error));
563 test_assert(error != NULL && strstr(error, "pkey") != NULL);
573 const char *error = NULL;
576 NULL, NULL, NULL, NULL, &error) == FALSE);
577 test_assert(error != NULL && strstr(error, "tab") != NULL);
580 error = NULL;
583 NULL, NULL, NULL, NULL, &error) == FALSE);
584 test_assert(error != NULL && strstr(error, "colon") != NULL);
587 error = NULL;
590 NULL, NULL, NULL, NULL, &error) == FALSE);
591 test_assert(error != NULL && strstr(error, "Unknown") != NULL);
601 const char *error = NULL;
602 bool ret = dcrypt_keypair_generate(&p1, DCRYPT_KEY_EC, 0, "secp521r1", &error);
604 ret = dcrypt_keypair_generate(&p2, DCRYPT_KEY_EC, 0, "secp521r1", &error);
610 ret = dcrypt_key_store_private(p1.priv, DCRYPT_FORMAT_DOVECOT, "ecdh-aes-256-ctr", buf, NULL, p2.pub, &error);
621 &kind, &enc_type, &enc_hash, &key_hash, &error);
642 const char *error;
643 bool ret = dcrypt_keypair_generate(&p1, DCRYPT_KEY_EC, 0, "secp521r1", &error);
647 ret = dcrypt_key_store_private(p1.priv, DCRYPT_FORMAT_DOVECOT, "aes-256-ctr", buf, "pw", NULL, &error);
658 &kind, &enc_type, &enc_hash, &key_hash, &error);
678 const char *error = NULL;
680 bool ret = dcrypt_keypair_generate(&orig, DCRYPT_KEY_EC, 0, "secp521r1", &error);
684 ret = dcrypt_key_store_private(orig.priv, DCRYPT_FORMAT_DOVECOT, "aes-256-ctr", buf, pw1, NULL, &error);
689 ret = dcrypt_key_load_private(&k1_priv, str_c(buf), pw1, NULL, &error);
694 ret = dcrypt_keypair_generate(&k2, DCRYPT_KEY_EC, 0, "secp521r1", &error);
700 ret = dcrypt_key_store_private(k2.priv, DCRYPT_FORMAT_DOVECOT, "ecdh-aes-256-ctr", buf2, NULL, k1_pub, &error);
708 ret = dcrypt_key_store_private(k1_priv, DCRYPT_FORMAT_DOVECOT, "aes-256-ctr", buf3, pw2, NULL, &error);
713 ret = dcrypt_key_load_private(&k2_priv, str_c(buf3), pw2, NULL, &error);
718 ret = dcrypt_key_load_private(&k3_priv, str_c(buf2), NULL, k2_priv, &error);
735 const char *error = NULL;
739 bool ret = dcrypt_key_load_public(&pub_key, key, &error);
741 test_assert(error != NULL);
743 error = NULL;
747 ret = dcrypt_key_load_private(&priv_key, key, NULL, NULL, &error);
749 test_assert(error != NULL);
758 const char *error;
760 if (!dcrypt_initialize(NULL, &set, &error)) {
761 i_error("No functional dcrypt backend found - skipping tests: %s", error);