summaryrefslogtreecommitdiff
path: root/lib/algorithms/ecc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/algorithms/ecc.c')
-rw-r--r--lib/algorithms/ecc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/algorithms/ecc.c b/lib/algorithms/ecc.c
index 50772f9993..53a89209f3 100644
--- a/lib/algorithms/ecc.c
+++ b/lib/algorithms/ecc.c
@@ -189,9 +189,11 @@ _gnutls_ecc_bits_to_curve (int bits)
gnutls_ecc_curve_t ret = GNUTLS_ECC_CURVE_SECP224R1;
GNUTLS_ECC_CURVE_LOOP (
- if (8*p->size > bits)
- break;
- ret = p->id;
+ if (8*p->size >= bits)
+ {
+ ret = p->id;
+ break;
+ }
);
return ret;