Lines Matching refs:new_key
164 DST_KEY *new_key = NULL;
167 new_key = (DST_KEY *) malloc(sizeof(*new_key));
168 if (new_key == NULL)
171 memset(new_key, 0, sizeof(*new_key));
172 new_key->dk_key_name = strdup(name);
173 if (new_key->dk_key_name == NULL) {
174 free(new_key);
177 new_key->dk_alg = alg;
178 new_key->dk_flags = flags;
179 new_key->dk_proto = protocol;
180 new_key->dk_KEY_struct = NULL;
181 new_key->dk_key_size = bits;
182 new_key->dk_func = dst_t_func[alg];
183 return (new_key);
954 DST_KEY *new_key = NULL;
966 new_key = dst_s_get_key_struct(name, alg, flags, protocol, bits);
967 if (new_key == NULL)
970 return (new_key);
971 if (new_key->dk_func == NULL || new_key->dk_func->generate == NULL) {
974 return (dst_free_key(new_key));
976 if (new_key->dk_func->generate(new_key, exp) <= 0) {
978 new_key->dk_key_name, new_key->dk_alg,
979 new_key->dk_key_size, exp));
980 return (dst_free_key(new_key));
983 dnslen = dst_key_to_dnskey(new_key, dns, sizeof(dns));
985 new_key->dk_id = dst_s_dns_key_id(dns, dnslen);
987 new_key->dk_id = 0;
989 return (new_key);