Lines Matching refs:ctx
17 TS_VERIFY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
19 if (ctx == NULL)
21 return ctx;
24 void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx)
26 OPENSSL_assert(ctx != NULL);
27 memset(ctx, 0, sizeof(*ctx));
30 void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx)
32 if (!ctx)
35 TS_VERIFY_CTX_cleanup(ctx);
36 OPENSSL_free(ctx);
39 int TS_VERIFY_CTX_add_flags(TS_VERIFY_CTX *ctx, int f)
41 ctx->flags |= f;
42 return ctx->flags;
45 int TS_VERIFY_CTX_set_flags(TS_VERIFY_CTX *ctx, int f)
47 ctx->flags = f;
48 return ctx->flags;
51 BIO *TS_VERIFY_CTX_set_data(TS_VERIFY_CTX *ctx, BIO *b)
53 ctx->data = b;
54 return ctx->data;
57 X509_STORE *TS_VERIFY_CTX_set_store(TS_VERIFY_CTX *ctx, X509_STORE *s)
59 ctx->store = s;
60 return ctx->store;
63 STACK_OF(X509) *TS_VERIFY_CTX_set_certs(TS_VERIFY_CTX *ctx,
66 ctx->certs = certs;
67 return ctx->certs;
70 unsigned char *TS_VERIFY_CTX_set_imprint(TS_VERIFY_CTX *ctx,
73 OPENSSL_free(ctx->imprint);
74 ctx->imprint = hexstr;
75 ctx->imprint_len = len;
76 return ctx->imprint;
79 void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx)
81 if (!ctx)
84 X509_STORE_free(ctx->store);
85 sk_X509_pop_free(ctx->certs, X509_free);
87 ASN1_OBJECT_free(ctx->policy);
89 X509_ALGOR_free(ctx->md_alg);
90 OPENSSL_free(ctx->imprint);
92 BIO_free_all(ctx->data);
94 ASN1_INTEGER_free(ctx->nonce);
96 GENERAL_NAME_free(ctx->tsa_name);
98 TS_VERIFY_CTX_init(ctx);
101 TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
103 TS_VERIFY_CTX *ret = ctx;
144 if (ctx)
145 TS_VERIFY_CTX_cleanup(ctx);