Hi!

I have just the same problem as Bill Rebey. I have an SSL server which
verifies client certificates by setting SSL_CTX_set_verify to
SSL_VERIFY_PEER|SSL_FAIL_IF_NO_PEER_CERT, and every time an SSL_accept
succeeds, there is a memory leak of approximately 10k (!) 

I call OpenSSL functions in the following order:

SSL_load_error_strings();
SSLeay_add_all_algorithms();
meth=SSLv23_server_method();
ctx=SSL_CTX_new(mth);

SSL_CTX_set_info_callback(ctx, callback)
SSL_CTX_set_verify(ctx,SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
                   cb);
SSL_CTX_use_certificate_file(ctx, filename, SSL_FILETYPE_PEM)
SSL_CTX_use_PrivateKey_file(ctx, filename, SSL_FILETYPE_PEM)
SSL_CTX_check_private_key(ctx)
SSL_CTX_load_verify_locations(ctx, cafile, NULL)
SSL_CTX_set_default_verify_paths(ctx)
SSL_CTX_set_client_CA_list(ctx, SSL_load_client_CA_file(cafile))

ssl = SSL_new(ctx)
SSL_clear(ssl)
SSL_set_fd(ssl, fd)
SSL_accept(ssl)

...

SSL_shutdown(ssl)
SSL_free(ssl)


At the end of the letter I have included some dmalloc summaries. (although
without symbolic function names - that 0x280dca0d is CRYPTO_malloc). 

Any help would be appreciated.


                                        Ciao,
                                                BLT


dmalloc output for no accepted SSL connections:

963914094: 2294:  total-size  count  source
963914094: 2294:       26781   1836  ra=0x280dca0d
963914094: 2294:       24896      1  ra=0x281c5eb1
963914094: 2294:       12448      1  ra=0x281c5e6a
963914094: 2294:        8192      1  ra=0x28089630
963914094: 2294:        4960      6  ra=0x280dca7b
963914094: 2294:        3048      1  ra=0x281c1a28
963914094: 2294:        2752     43  ra=0x281c1e69
963914094: 2294:        1024      1  ra=0x281c1575
963914094: 2294:         976      2  ra=0x2818f442
963914094: 2294:         512      1  ra=0x280829c5
963914094: 2294:         488      1  ra=0x281c5ad0
963914094: 2294:         408      6  ra=0x281c6b40
963914094: 2294:         292      1  ra=0x280776ad
963914094: 2294:         104      1  ra=0x804f640
963914094: 2294:          40      1  ra=0x281c90b6
963914094: 2294:          28      1  ra=0x28081016
963914094: 2294:          20      2  ra=0x280837a5
963914094: 2294:          16      1  ra=0x28080c1d
963914094: 2294:          10      1  ra=0x28080c3b
963914094: 2294:           3      1  ra=0x281c13f0
963914094: 2294:           2      2  ra=0x280880b0
963914094: 2294:       87000   1911  Total of 21
963914094: 2294:  unknown memory: 1911 pointers, 87000 bytes


For one connection:

963914104: 3056:  total-size  count  source
963914104: 3056:       32048   1963  ra=0x280dca0d
963914104: 3056:       24896      1  ra=0x281c5eb1
963914104: 3056:       12448      1  ra=0x281c5e6a
963914104: 3056:        8192      1  ra=0x28089630
963914104: 3056:        5120      8  ra=0x280dca7b
963914104: 3056:        3048      1  ra=0x281c1a28
963914104: 3056:        2816     44  ra=0x281c1e69
963914104: 3056:        1464      3  ra=0x2818f442
963914104: 3056:        1024      1  ra=0x281c1575
963914104: 3056:         512      1  ra=0x280829c5
963914104: 3056:         488      1  ra=0x281c5ad0
963914104: 3056:         476      7  ra=0x281c6b40
963914104: 3056:         328      2  ra=0x804f9a0
963914104: 3056:         292      1  ra=0x280776ad
963914104: 3056:         104      1  ra=0x804f640
963914104: 3056:          40      1  ra=0x281c90b6
963914104: 3056:          28      1  ra=0x28081016
963914104: 3056:          20      2  ra=0x280837a5
963914104: 3056:          16      1  ra=0x28080c1d
963914104: 3056:          10      1  ra=0x28080c3b
963914104: 3056:           3      1  ra=0x281c13f0
963914104: 3056:           2      2  ra=0x280880b0
963914104: 3056:       93375   2045  Total of 22
963914104: 3056:  unknown memory: 2045 pointers, 93375 bytes

And for five connections:

963914123: 5526:  total-size  count  source
963914123: 5526:       47868   2411  ra=0x280dca0d
963914123: 5526:       24896      1  ra=0x281c5eb1
963914123: 5526:       12448      1  ra=0x281c5e6a
963914123: 5526:        8192      1  ra=0x28089630
963914123: 5526:        5760     16  ra=0x280dca7b
963914123: 5526:        3416      7  ra=0x2818f442
963914123: 5526:        3048      1  ra=0x281c1a28
963914123: 5526:        2816     44  ra=0x281c1e69
963914123: 5526:        1640     10  ra=0x804f9a0
963914123: 5526:        1024      1  ra=0x281c1575
963914123: 5526:         748     11  ra=0x281c6b40
963914123: 5526:         512      1  ra=0x280829c5
963914123: 5526:         488      1  ra=0x281c5ad0
963914123: 5526:         292      1  ra=0x280776ad
963914123: 5526:         104      1  ra=0x804f640
963914123: 5526:          40      1  ra=0x281c90b6
963914123: 5526:          28      1  ra=0x28081016
963914123: 5526:          20      2  ra=0x280837a5
963914123: 5526:          16      1  ra=0x28080c1d
963914123: 5526:          10      1  ra=0x28080c3b
963914123: 5526:           3      1  ra=0x281c13f0
963914123: 5526:           2      2  ra=0x280880b0
963914123: 5526:      113371   2517  Total of 22
963914123: 5526:  unknown memory: 2517 pointers, 113371 bytes



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to