Lines Matching refs:priv

132 check_rsa(const dst_private_t *priv) {
140 for (j = 0; j < priv->nelements; j++) {
142 if (priv->elements[j].tag == TAG(DST_ALG_RSAMD5, i))
170 check_dh(const dst_private_t *priv) {
172 if (priv->nelements != DH_NTAGS)
175 for (j = 0; j < priv->nelements; j++)
176 if (priv->elements[j].tag == TAG(DST_ALG_DH, i))
178 if (j == priv->nelements)
185 check_dsa(const dst_private_t *priv) {
187 if (priv->nelements != DSA_NTAGS)
190 for (j = 0; j < priv->nelements; j++)
191 if (priv->elements[j].tag == TAG(DST_ALG_DSA, i))
193 if (j == priv->nelements)
200 check_hmac_md5(const dst_private_t *priv, isc_boolean_t old) {
203 if (priv->nelements != HMACMD5_NTAGS) {
208 if (old && priv->nelements == OLD_HMACMD5_NTAGS &&
209 priv->elements[0].tag == TAG_HMACMD5_KEY)
217 for (j = 0; j < priv->nelements; j++)
218 if (priv->elements[j].tag == TAG(DST_ALG_HMACMD5, i))
220 if (j == priv->nelements)
227 check_hmac_sha(const dst_private_t *priv, unsigned int ntags,
231 if (priv->nelements != ntags)
234 for (j = 0; j < priv->nelements; j++)
235 if (priv->elements[j].tag == TAG(alg, i))
237 if (j == priv->nelements)
244 check_data(const dst_private_t *priv, const unsigned int alg,
254 return (check_rsa(priv));
256 return (check_dh(priv));
259 return (check_dsa(priv));
261 return (check_hmac_md5(priv, old));
263 return (check_hmac_sha(priv, HMACSHA1_NTAGS, alg));
265 return (check_hmac_sha(priv, HMACSHA224_NTAGS, alg));
267 return (check_hmac_sha(priv, HMACSHA256_NTAGS, alg));
269 return (check_hmac_sha(priv, HMACSHA384_NTAGS, alg));
271 return (check_hmac_sha(priv, HMACSHA512_NTAGS, alg));
278 dst__privstruct_free(dst_private_t *priv, isc_mem_t *mctx) {
281 if (priv == NULL)
283 for (i = 0; i < priv->nelements; i++) {
284 if (priv->elements[i].data == NULL)
286 memset(priv->elements[i].data, 0, MAXFIELDSIZE);
287 isc_mem_put(mctx, priv->elements[i].data, MAXFIELDSIZE);
289 priv->nelements = 0;
294 isc_mem_t *mctx, dst_private_t *priv)
303 REQUIRE(priv != NULL);
305 priv->nelements = 0;
306 memset(priv->elements, 0, sizeof(priv->elements));
403 priv->elements[n].tag = tag;
414 priv->elements[n].length = r.length;
415 priv->elements[n].data = r.base;
421 priv->nelements = n;
423 check = check_data(priv, alg, ISC_TRUE);
435 priv->nelements = n;
436 dst__privstruct_free(priv, mctx);
444 dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv,
455 REQUIRE(priv != NULL);
457 ret = check_data(priv, dst_key_alg(key), ISC_FALSE);
531 for (i = 0; i < priv->nelements; i++) {
536 s = find_tag(priv->elements[i].tag);
538 r.base = priv->elements[i].data;
539 r.length = priv->elements[i].length;