Lines Matching refs:sctx

25     SCT_CTX *sctx = OPENSSL_zalloc(sizeof(*sctx));  in SCT_CTX_new()  local
27 if (sctx == NULL) in SCT_CTX_new()
30 sctx->libctx = libctx; in SCT_CTX_new()
32 sctx->propq = OPENSSL_strdup(propq); in SCT_CTX_new()
33 if (sctx->propq == NULL) { in SCT_CTX_new()
34 OPENSSL_free(sctx); in SCT_CTX_new()
39 return sctx; in SCT_CTX_new()
42 void SCT_CTX_free(SCT_CTX *sctx) in SCT_CTX_free() argument
44 if (sctx == NULL) in SCT_CTX_free()
46 EVP_PKEY_free(sctx->pkey); in SCT_CTX_free()
47 OPENSSL_free(sctx->pkeyhash); in SCT_CTX_free()
48 OPENSSL_free(sctx->ihash); in SCT_CTX_free()
49 OPENSSL_free(sctx->certder); in SCT_CTX_free()
50 OPENSSL_free(sctx->preder); in SCT_CTX_free()
51 OPENSSL_free(sctx->propq); in SCT_CTX_free()
52 OPENSSL_free(sctx); in SCT_CTX_free()
119 int SCT_CTX_set1_cert(SCT_CTX *sctx, X509 *cert, X509 *presigner) in SCT_CTX_set1_cert() argument
185 OPENSSL_free(sctx->certder); in SCT_CTX_set1_cert()
186 sctx->certder = certder; in SCT_CTX_set1_cert()
187 sctx->certderlen = certderlen; in SCT_CTX_set1_cert()
189 OPENSSL_free(sctx->preder); in SCT_CTX_set1_cert()
190 sctx->preder = preder; in SCT_CTX_set1_cert()
191 sctx->prederlen = prederlen; in SCT_CTX_set1_cert()
201 __owur static int ct_public_key_hash(SCT_CTX *sctx, X509_PUBKEY *pkey, in ct_public_key_hash() argument
208 EVP_MD *sha256 = EVP_MD_fetch(sctx->libctx, "SHA2-256", sctx->propq); in ct_public_key_hash()
245 int SCT_CTX_set1_issuer(SCT_CTX *sctx, const X509 *issuer) in SCT_CTX_set1_issuer() argument
247 return SCT_CTX_set1_issuer_pubkey(sctx, X509_get_X509_PUBKEY(issuer)); in SCT_CTX_set1_issuer()
250 int SCT_CTX_set1_issuer_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey) in SCT_CTX_set1_issuer_pubkey() argument
252 return ct_public_key_hash(sctx, pubkey, &sctx->ihash, &sctx->ihashlen); in SCT_CTX_set1_issuer_pubkey()
255 int SCT_CTX_set1_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey) in SCT_CTX_set1_pubkey() argument
262 if (!ct_public_key_hash(sctx, pubkey, &sctx->pkeyhash, &sctx->pkeyhashlen)) { in SCT_CTX_set1_pubkey()
267 EVP_PKEY_free(sctx->pkey); in SCT_CTX_set1_pubkey()
268 sctx->pkey = pkey; in SCT_CTX_set1_pubkey()
272 void SCT_CTX_set_time(SCT_CTX *sctx, uint64_t time_in_ms) in SCT_CTX_set_time() argument
274 sctx->epoch_time_in_ms = time_in_ms; in SCT_CTX_set_time()