diff options
author | Adriaan de Jong <dejong@fox-it.com> | 2012-02-14 11:11:24 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2012-03-30 11:33:03 +0200 |
commit | 00b973f8af85c3ea8fa3cef80eec55e8dc139b27 (patch) | |
tree | 42ad20eb89be0436bee7a397f2269272a4799414 /src/openvpn/pkcs11.c | |
parent | 31444111839f0720d6173a71f66fa3a988bcf9fb (diff) | |
download | openvpn-00b973f8af85c3ea8fa3cef80eec55e8dc139b27.tar.gz openvpn-00b973f8af85c3ea8fa3cef80eec55e8dc139b27.tar.xz openvpn-00b973f8af85c3ea8fa3cef80eec55e8dc139b27.zip |
Migrated x509_get_subject to use of the garbage collector
This also cleans up a messy call in pkcs11.c to _openssl_get_subject, as discussed at FOSDEM.
Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'src/openvpn/pkcs11.c')
-rw-r--r-- | src/openvpn/pkcs11.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/openvpn/pkcs11.c b/src/openvpn/pkcs11.c index fd609d4..a6b8db5 100644 --- a/src/openvpn/pkcs11.c +++ b/src/openvpn/pkcs11.c @@ -834,7 +834,8 @@ show_pkcs11_ids ( ); for (current = user_certificates;current != NULL; current = current->next) { pkcs11h_certificate_t certificate = NULL; - char dn[1024] = {0}; + struct gc_arena gc = gc_new(); + char *dn = NULL; char serial[1024] = {0}; char *ser = NULL; size_t ser_len = 0; @@ -883,10 +884,9 @@ show_pkcs11_ids ( } if ( - (pkcs11_certificate_dn ( + (dn = pkcs11_certificate_dn ( certificate, - dn, - sizeof(dn) + &gc )) ) { goto cleanup1; @@ -927,6 +927,8 @@ show_pkcs11_ids ( free (ser); ser = NULL; } + + gc_free (&gc); } cleanup: |