Lines Matching defs:priv

189 check_rsa(const dst_private_t *priv, isc_boolean_t external) {
196 return ((priv->nelements == 0) ? 0 : -1);
201 for (j = 0; j < priv->nelements; j++) {
203 if (priv->elements[j].tag == TAG(DST_ALG_RSAMD5, i))
232 check_dh(const dst_private_t *priv) {
234 if (priv->nelements != DH_NTAGS)
237 for (j = 0; j < priv->nelements; j++)
238 if (priv->elements[j].tag == TAG(DST_ALG_DH, i))
240 if (j == priv->nelements)
249 check_dsa(const dst_private_t *priv, isc_boolean_t external) {
253 return ((priv->nelements == 0)? 0 : -1);
255 if (priv->nelements != DSA_NTAGS)
259 for (j = 0; j < priv->nelements; j++)
260 if (priv->elements[j].tag == TAG(DST_ALG_DSA, i))
262 if (j == priv->nelements)
270 check_gost(const dst_private_t *priv, isc_boolean_t external) {
273 return ((priv->nelements == 0)? 0 : -1);
275 if (priv->nelements != GOST_NTAGS)
277 if ((priv->elements[0].tag != TAG(DST_ALG_ECCGOST, 0)) &&
278 (priv->elements[0].tag != TAG(DST_ALG_ECCGOST, 1)))
284 check_ecdsa(const dst_private_t *priv, isc_boolean_t external) {
291 return ((priv->nelements == 0) ? 0 : -1);
295 for (j = 0; j < priv->nelements; j++) {
297 if (priv->elements[j].tag == TAG(DST_ALG_ECDSA256, i))
316 check_eddsa(const dst_private_t *priv, isc_boolean_t external) {
323 return ((priv->nelements == 0) ? 0 : -1);
327 for (j = 0; j < priv->nelements; j++) {
329 if (priv->elements[j].tag == TAG(DST_ALG_ED25519, i))
349 check_hmac_md5(const dst_private_t *priv, isc_boolean_t old) {
352 if (priv->nelements != HMACMD5_NTAGS) {
357 if (old && priv->nelements == OLD_HMACMD5_NTAGS &&
358 priv->elements[0].tag == TAG_HMACMD5_KEY)
366 for (j = 0; j < priv->nelements; j++)
367 if (priv->elements[j].tag == TAG(DST_ALG_HMACMD5, i))
369 if (j == priv->nelements)
377 check_hmac_sha(const dst_private_t *priv, unsigned int ntags,
381 if (priv->nelements != ntags)
384 for (j = 0; j < priv->nelements; j++)
385 if (priv->elements[j].tag == TAG(alg, i))
387 if (j == priv->nelements)
394 check_data(const dst_private_t *priv, const unsigned int alg,
409 return (check_rsa(priv, external));
412 return (check_dh(priv));
417 return (check_dsa(priv, external));
420 return (check_gost(priv, external));
423 return (check_ecdsa(priv, external));
426 return (check_eddsa(priv, external));
429 return (check_hmac_md5(priv, old));
432 return (check_hmac_sha(priv, HMACSHA1_NTAGS, alg));
434 return (check_hmac_sha(priv, HMACSHA224_NTAGS, alg));
436 return (check_hmac_sha(priv, HMACSHA256_NTAGS, alg));
438 return (check_hmac_sha(priv, HMACSHA384_NTAGS, alg));
440 return (check_hmac_sha(priv, HMACSHA512_NTAGS, alg));
447 dst__privstruct_free(dst_private_t *priv, isc_mem_t *mctx) {
450 if (priv == NULL)
452 for (i = 0; i < priv->nelements; i++) {
453 if (priv->elements[i].data == NULL)
455 memset(priv->elements[i].data, 0, MAXFIELDSIZE);
456 isc_mem_put(mctx, priv->elements[i].data, MAXFIELDSIZE);
458 priv->nelements = 0;
463 isc_mem_t *mctx, dst_private_t *priv)
474 REQUIRE(priv != NULL);
476 priv->nelements = 0;
477 memset(priv->elements, 0, sizeof(priv->elements));
620 priv->elements[n].tag = tag;
632 priv->elements[n].length = r.length;
633 priv->elements[n].data = r.base;
634 priv->nelements++;
642 if (external && priv->nelements != 0) {
648 check = check_data(priv, alg == DST_ALG_RSA ? DST_ALG_RSASHA1 : alg,
651 check = check_data(priv, alg, ISC_TRUE, external);
666 dst__privstruct_free(priv, mctx);
674 dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv,
690 REQUIRE(priv != NULL);
692 ret = check_data(priv, dst_key_alg(key), ISC_FALSE, key->external);
807 for (i = 0; i < priv->nelements; i++) {
810 s = find_tag(priv->elements[i].tag);
812 r.base = priv->elements[i].data;
813 r.length = priv->elements[i].length;