Lines Matching refs:dhg
44 parse_prime(int linenum, char *line, struct dhgroup *dhg) in parse_prime() argument
86 (dhg->size = (int)strtonum(strsize, 0, 64*1024, &errstr)) == 0 || in parse_prime()
90 dhg->size++; in parse_prime()
98 if ((dhg->g = BN_new()) == NULL) in parse_prime()
100 if ((dhg->p = BN_new()) == NULL) in parse_prime()
102 if (BN_hex2bn(&dhg->g, gen) == 0) in parse_prime()
105 if (BN_hex2bn(&dhg->p, prime) == 0) in parse_prime()
108 if (BN_num_bits(dhg->p) != dhg->size) in parse_prime()
111 if (BN_is_zero(dhg->g) || BN_is_one(dhg->g)) in parse_prime()
117 BN_clear_free(dhg->g); in parse_prime()
118 BN_clear_free(dhg->p); in parse_prime()
131 struct dhgroup dhg; in choose_dh() local
144 if (!parse_prime(linenum, line, &dhg)) in choose_dh()
146 BN_clear_free(dhg.g); in choose_dh()
147 BN_clear_free(dhg.p); in choose_dh()
149 if (dhg.size > max || dhg.size < min) in choose_dh()
152 if ((dhg.size > wantbits && dhg.size < best) || in choose_dh()
153 (dhg.size > best && best < wantbits)) { in choose_dh()
154 best = dhg.size; in choose_dh()
157 if (dhg.size == best) in choose_dh()
171 if (!parse_prime(linenum, line, &dhg)) in choose_dh()
173 if ((dhg.size > max || dhg.size < min) || in choose_dh()
174 dhg.size != best || in choose_dh()
176 BN_clear_free(dhg.g); in choose_dh()
177 BN_clear_free(dhg.p); in choose_dh()
187 return (dh_new_group(dhg.g, dhg.p)); in choose_dh()