summaryrefslogtreecommitdiff
path: root/dh.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-04-09 20:59:48 +1000
committerDamien Miller <djm@mindrot.org>2003-04-09 20:59:48 +1000
commit996acd2476d9d34b18bb4f99012ea0927458f418 (patch)
tree1420f273ae5395fc0adc9aa25dcd44fe821884a6 /dh.c
parent5f16a5ee4e35d36e72f8f72fb2334087cb2ea680 (diff)
*** empty log message ***
Diffstat (limited to 'dh.c')
-rw-r--r--dh.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/dh.c b/dh.c
index 1be51953c..fd41e2102 100644
--- a/dh.c
+++ b/dh.c
@@ -112,7 +112,7 @@ choose_dh(int min, int wantbits, int max)
112 112
113 if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL && 113 if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL &&
114 (f = fopen(_PATH_DH_PRIMES, "r")) == NULL) { 114 (f = fopen(_PATH_DH_PRIMES, "r")) == NULL) {
115 log("WARNING: %s does not exist, using old modulus", _PATH_DH_MODULI); 115 logit("WARNING: %s does not exist, using old modulus", _PATH_DH_MODULI);
116 return (dh_new_group1()); 116 return (dh_new_group1());
117 } 117 }
118 118
@@ -140,7 +140,7 @@ choose_dh(int min, int wantbits, int max)
140 140
141 if (bestcount == 0) { 141 if (bestcount == 0) {
142 fclose(f); 142 fclose(f);
143 log("WARNING: no suitable primes in %s", _PATH_DH_PRIMES); 143 logit("WARNING: no suitable primes in %s", _PATH_DH_PRIMES);
144 return (NULL); 144 return (NULL);
145 } 145 }
146 146
@@ -176,7 +176,7 @@ dh_pub_is_valid(DH *dh, BIGNUM *dh_pub)
176 int bits_set = 0; 176 int bits_set = 0;
177 177
178 if (dh_pub->neg) { 178 if (dh_pub->neg) {
179 log("invalid public DH value: negativ"); 179 logit("invalid public DH value: negativ");
180 return 0; 180 return 0;
181 } 181 }
182 for (i = 0; i <= n; i++) 182 for (i = 0; i <= n; i++)
@@ -187,7 +187,7 @@ dh_pub_is_valid(DH *dh, BIGNUM *dh_pub)
187 /* if g==2 and bits_set==1 then computing log_g(dh_pub) is trivial */ 187 /* if g==2 and bits_set==1 then computing log_g(dh_pub) is trivial */
188 if (bits_set > 1 && (BN_cmp(dh_pub, dh->p) == -1)) 188 if (bits_set > 1 && (BN_cmp(dh_pub, dh->p) == -1))
189 return 1; 189 return 1;
190 log("invalid public DH value (%d/%d)", bits_set, BN_num_bits(dh->p)); 190 logit("invalid public DH value (%d/%d)", bits_set, BN_num_bits(dh->p));
191 return 0; 191 return 0;
192} 192}
193 193