Hi,
On Tue, May 09, 2017 at 10:12:43AM +0200, Steffan Karger wrote:
> goto cleanup;
> }
>
> - if (-1 == mbedtls_x509_dn_gets(dn, sizeof(dn), &mbed_crt.subject))
> + if (!(ret = x509_get_subject(&mbed_crt, gc)))
> {
> msg(M_FATAL, "PKCS#11: mbed TLS cannot parse subject");
> goto cleanup;
> }
>
> - ret = string_alloc(dn, gc);
> -
ACK.
x509_get_subject() does exactly the same thing, just with error handling
for the case "mbedtls_x509_dn_gets() returns 0". So - less code, and
error case handled :-)
(Note: cleanup patch expected, to remove the "goto cleanup" calls after
a msg(M_FATAL, ...) line which is guaranteed to never return)
gert
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]
fax: +49-89-35655025 [email protected]
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
