Commit a8236c8c authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Fix various memory leaks in SSL, apps and DSA

parent 1750ebcb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -5,9 +5,15 @@

 Changes between 0.9.1c and 0.9.2

  *) Run extensive memory leak checks on SSL apps. Fixed *lots* of memory
     leaks in ssl/ relating to new X509_get_pubkey() behaviour. Also fixes
     in apps/ and an unrellated leak in crypto/dsa/dsa_vrf.c
     [Steve Henson]

  *) Support for RAW extensions where an arbitrary extension can be
     created by including its DER encoding. See apps/openssl.cnf for
     an example.
     [Steve Henson]

  *) Make sure latest Perl versions don't interpret some generated C array
     code as Perl array code in the crypto/err/err_genc.pl script.
+7 −3
Original line number Diff line number Diff line
@@ -156,9 +156,13 @@ char *key_file;
		ssl=SSL_new(ctx);
		x509=SSL_get_certificate(ssl);

		if (x509 != NULL)
			EVP_PKEY_copy_parameters(X509_get_pubkey(x509),
		if (x509 != NULL) {
			EVP_PKEY *pktmp;
			pktmp = X509_get_pubkey(x509);
			EVP_PKEY_copy_parameters(pktmp,
						SSL_get_privatekey(ssl));
			EVP_PKEY_free(pktmp);
		}
		SSL_free(ssl);
		*/

+6 −2
Original line number Diff line number Diff line
@@ -743,9 +743,13 @@ int full;
	BIO_printf(bio,"%s, Cipher is %s\n",
		SSL_CIPHER_get_version(c),
		SSL_CIPHER_get_name(c));
	if (peer != NULL)
	if (peer != NULL) {
		EVP_PKEY *pktmp;
		pktmp = X509_get_pubkey(peer);
		BIO_printf(bio,"Server public key is %d bit\n",
			EVP_PKEY_bits(X509_get_pubkey(peer)));
							 EVP_PKEY_bits(pktmp));
		EVP_PKEY_free(pktmp);
	}
	SSL_SESSION_print(bio,SSL_get_session(s));
	BIO_printf(bio,"---\n");
	if (peer != NULL)
+5 −1
Original line number Diff line number Diff line
@@ -770,8 +770,12 @@ int full;
		SSL_CIPHER_get_version(c),
		SSL_CIPHER_get_name(c));
	if (peer != NULL)
	{
		EVP_PKEY *pktmp;
		BIO_printf(bio,"Server public key is %d bit\n",
			EVP_PKEY_bits(X509_get_pubkey(peer)));
							EVP_PKEY_bits(pktmp));
		EVP_PKEY_free(pktmp);
	}
	SSL_SESSION_print(bio,SSL_get_session(s));
	BIO_printf(bio,"---\n");
	if (peer != NULL)
+0 −1
Original line number Diff line number Diff line
@@ -91,7 +91,6 @@ DSA *dsa;
	int ret = -1;

	if ((ctx=BN_CTX_new()) == NULL) goto err;
	if ((mont=BN_MONT_CTX_new()) == NULL) goto err;

	BN_init(&u1);
	BN_init(&u2);
Loading