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()
32 sctx->libctx = libctx; in SCT_CTX_new()
34 sctx->propq = OPENSSL_strdup(propq); in SCT_CTX_new()
35 if (sctx->propq == NULL) { in SCT_CTX_new()
37 OPENSSL_free(sctx); in SCT_CTX_new()
42 return sctx; in SCT_CTX_new()
45 void SCT_CTX_free(SCT_CTX *sctx) in SCT_CTX_free() argument
47 if (sctx == NULL) in SCT_CTX_free()
49 EVP_PKEY_free(sctx->pkey); in SCT_CTX_free()
50 OPENSSL_free(sctx->pkeyhash); in SCT_CTX_free()
51 OPENSSL_free(sctx->ihash); in SCT_CTX_free()
52 OPENSSL_free(sctx->certder); in SCT_CTX_free()
53 OPENSSL_free(sctx->preder); in SCT_CTX_free()
54 OPENSSL_free(sctx->propq); in SCT_CTX_free()
55 OPENSSL_free(sctx); in SCT_CTX_free()
122 int SCT_CTX_set1_cert(SCT_CTX *sctx, X509 *cert, X509 *presigner) in SCT_CTX_set1_cert() argument
188 OPENSSL_free(sctx->certder); in SCT_CTX_set1_cert()
189 sctx->certder = certder; in SCT_CTX_set1_cert()
190 sctx->certderlen = certderlen; in SCT_CTX_set1_cert()
192 OPENSSL_free(sctx->preder); in SCT_CTX_set1_cert()
193 sctx->preder = preder; in SCT_CTX_set1_cert()
194 sctx->prederlen = prederlen; in SCT_CTX_set1_cert()
204 __owur static int ct_public_key_hash(SCT_CTX *sctx, X509_PUBKEY *pkey, in ct_public_key_hash() argument
211 EVP_MD *sha256 = EVP_MD_fetch(sctx->libctx, "SHA2-256", sctx->propq); in ct_public_key_hash()
248 int SCT_CTX_set1_issuer(SCT_CTX *sctx, const X509 *issuer) in SCT_CTX_set1_issuer() argument
250 return SCT_CTX_set1_issuer_pubkey(sctx, X509_get_X509_PUBKEY(issuer)); in SCT_CTX_set1_issuer()
253 int SCT_CTX_set1_issuer_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey) in SCT_CTX_set1_issuer_pubkey() argument
255 return ct_public_key_hash(sctx, pubkey, &sctx->ihash, &sctx->ihashlen); in SCT_CTX_set1_issuer_pubkey()
258 int SCT_CTX_set1_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey) in SCT_CTX_set1_pubkey() argument
265 if (!ct_public_key_hash(sctx, pubkey, &sctx->pkeyhash, &sctx->pkeyhashlen)) { in SCT_CTX_set1_pubkey()
270 EVP_PKEY_free(sctx->pkey); in SCT_CTX_set1_pubkey()
271 sctx->pkey = pkey; in SCT_CTX_set1_pubkey()
275 void SCT_CTX_set_time(SCT_CTX *sctx, uint64_t time_in_ms) in SCT_CTX_set_time() argument
277 sctx->epoch_time_in_ms = time_in_ms; in SCT_CTX_set_time()