]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Better check for null signature method.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 4 May 2014 10:19:33 +0000 (12:19 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 4 May 2014 10:20:50 +0000 (12:20 +0200)
Issue identified using valgrind and the Codenomicon TLS test suite.

lib/algorithms/sign.c

index 5da5bf36685b5cd1ec511bcd2163697ef8951248..e69cd0c531f41265a854eea111fb615988a5cfad 100644 (file)
@@ -299,7 +299,8 @@ _gnutls_tls_aid_to_sign(const sign_algorithm_st * aid)
 {
        gnutls_sign_algorithm_t ret = GNUTLS_SIGN_UNKNOWN;
 
-       if (memcmp(aid, &unknown_tls_aid, sizeof(*aid)) == 0)
+       if (aid->hash_algorithm == unknown_tls_aid.hash_algorithm &&
+               aid->sign_algorithm == unknown_tls_aid.sign_algorithm)
                return ret;
 
        GNUTLS_SIGN_LOOP(