Lines Matching defs:dane
170 static void dane_final(SSL_DANE *dane)
172 sk_danetls_record_pop_free(dane->trecs, tlsa_free);
173 dane->trecs = NULL;
175 sk_X509_pop_free(dane->certs, X509_free);
176 dane->certs = NULL;
178 X509_free(dane->mcert);
179 dane->mcert = NULL;
180 dane->mtlsa = NULL;
181 dane->mdpth = -1;
182 dane->pdpth = -1;
186 * dane_copy - Copy dane configuration, sans verification state.
193 if (!DANETLS_ENABLED(&from->dane))
196 num = sk_danetls_record_num(from->dane.trecs);
197 dane_final(&to->dane);
198 to->dane.flags = from->dane.flags;
199 to->dane.dctx = &to->ctx->dane;
200 to->dane.trecs = sk_danetls_record_new_reserve(NULL, num);
202 if (to->dane.trecs == NULL) {
208 danetls_record *t = sk_danetls_record_value(from->dane.trecs, i);
262 static const EVP_MD *tlsa_md_get(SSL_DANE *dane, uint8_t mtype)
264 if (mtype > dane->dctx->mdmax)
266 return dane->dctx->mdevp[mtype];
269 static int dane_tlsa_add(SSL_DANE *dane,
280 if (dane->trecs == NULL) {
301 md = tlsa_md_get(dane, mtype);
380 if ((dane->certs == NULL &&
381 (dane->certs = sk_X509_new_null()) == NULL) ||
382 !sk_X509_push(dane->certs, cert)) {
426 num = sk_danetls_record_num(dane->trecs);
428 danetls_record *rec = sk_danetls_record_value(dane->trecs, i);
438 if (dane->dctx->mdord[rec->mtype] > dane->dctx->mdord[mtype])
443 if (!sk_danetls_record_insert(dane->trecs, t, i)) {
448 dane->umask |= DANETLS_USAGE_BIT(usage);
629 s->dane.mdpth = -1;
630 s->dane.pdpth = -1;
631 X509_free(s->dane.mcert);
632 s->dane.mcert = NULL;
633 s->dane.mtlsa = NULL;
715 s->dane.flags = ctx->dane.flags;
1030 return dane_ctx_enable(&ctx->dane);
1035 unsigned long orig = ctx->dane.flags;
1037 ctx->dane.flags |= flags;
1043 unsigned long orig = ctx->dane.flags;
1045 ctx->dane.flags &= ~flags;
1051 SSL_DANE *dane = &s->dane;
1053 if (s->ctx->dane.mdmax == 0) {
1057 if (dane->trecs != NULL) {
1080 dane->mdpth = -1;
1081 dane->pdpth = -1;
1082 dane->dctx = &s->ctx->dane;
1083 dane->trecs = sk_danetls_record_new_null();
1085 if (dane->trecs == NULL) {
1094 unsigned long orig = ssl->dane.flags;
1096 ssl->dane.flags |= flags;
1102 unsigned long orig = ssl->dane.flags;
1104 ssl->dane.flags &= ~flags;
1110 SSL_DANE *dane = &s->dane;
1112 if (!DANETLS_ENABLED(dane) || s->verify_result != X509_V_OK)
1114 if (dane->mtlsa) {
1116 *mcert = dane->mcert;
1118 *mspki = (dane->mcert == NULL) ? dane->mtlsa->spki : NULL;
1120 return dane->mdpth;
1126 SSL_DANE *dane = &s->dane;
1128 if (!DANETLS_ENABLED(dane) || s->verify_result != X509_V_OK)
1130 if (dane->mtlsa) {
1132 *usage = dane->mtlsa->usage;
1134 *selector = dane->mtlsa->selector;
1136 *mtype = dane->mtlsa->mtype;
1138 *data = dane->mtlsa->data;
1140 *dlen = dane->mtlsa->dlen;
1142 return dane->mdpth;
1147 return &s->dane;
1153 return dane_tlsa_add(&s->dane, usage, selector, mtype, data, dlen);
1159 return dane_mtype_set(&ctx->dane, md, mtype, ord);
1200 dane_final(&s->dane);
3480 dane_ctx_final(&a->dane);
5246 SSL_DANE *dane = &s->dane;
5270 if (DANETLS_ENABLED(dane) && dane->mtlsa != NULL) {
5271 switch (dane->mtlsa->usage) {