]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
session state: combined srp and dh prime bits variables
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Wed, 8 Nov 2017 10:45:25 +0000 (11:45 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 19 Feb 2018 14:29:35 +0000 (15:29 +0100)
They were being used for the same purpose, and SRP as well as
DH, do not overlap to require two different variables.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
lib/gnutls_int.h
lib/srp.c

index 690cd9a59db03e57ecc5ca30db99feb17386b891..9e50af67ce6d450b7bb06f1fa6d8ed2960b3480b 100644 (file)
@@ -945,8 +945,13 @@ typedef struct {
        bool allow_key_usage_violation;
        bool allow_wrong_pms;
        bool dumbfw;
-       unsigned int dh_prime_bits;     /* old (deprecated) variable */
 
+       /* old (deprecated) variable. This is used for both srp_prime_bits
+        * and dh_prime_bits as they don't overlap */
+       /* For SRP: minimum bits to allow for SRP
+        * use gnutls_srp_set_prime_bits() to adjust it.
+        */
+       uint16_t dh_prime_bits; /* srp_prime_bits */
 
        /* resumed session */
        bool resumed;   /* RESUME_TRUE or FALSE - if we are resuming a session */
@@ -1075,11 +1080,6 @@ typedef struct {
         */
        int errnum;
 
-       /* minimum bits to allow for SRP
-        * use gnutls_srp_set_prime_bits() to adjust it.
-        */
-       uint16_t srp_prime_bits;
-
        /* A handshake process has been completed */
        bool initial_negotiation_completed;
 
index eb4b8361d9d1acbfccd316c64f81109428035f13..c3eb8e684748c84d653205efd242e1b9f5c86134 100644 (file)
--- a/lib/srp.c
+++ b/lib/srp.c
@@ -800,7 +800,7 @@ gnutls_srp_verifier(const char *username, const char *password,
  **/
 void gnutls_srp_set_prime_bits(gnutls_session_t session, unsigned int bits)
 {
-       session->internals.srp_prime_bits = bits;
+       session->internals.dh_prime_bits = bits;
 }
 
 /**