libpurple/plugins/ssl/ssl-gnutls.c

branch
soc.2007.certmgr
changeset 18591
9d7c99e312b9
parent 18496
3bb8e716482e
child 18592
8ac486cb3d21
equal deleted inserted replaced
18590:d240b212c2d4 18591:9d7c99e312b9
511 /* Obtain the output size required */ 511 /* Obtain the output size required */
512 ret = gnutls_x509_crt_export(crt_dat, GNUTLS_X509_FMT_PEM, 512 ret = gnutls_x509_crt_export(crt_dat, GNUTLS_X509_FMT_PEM,
513 NULL, /* Provide no buffer yet */ 513 NULL, /* Provide no buffer yet */
514 &out_size /* Put size here */ 514 &out_size /* Put size here */
515 ); 515 );
516 g_return_val_if_fail(ret == 0, FALSE); 516 g_return_val_if_fail(ret == GNUTLS_E_SHORT_MEMORY_BUFFER, FALSE);
517 517
518 /* Now allocate a buffer and *really* export it */ 518 /* Now allocate a buffer and *really* export it */
519 out_buf = g_new0(gchar, out_size); 519 out_buf = g_new0(gchar, out_size);
520 ret = gnutls_x509_crt_export(crt_dat, GNUTLS_X509_FMT_PEM, 520 ret = gnutls_x509_crt_export(crt_dat, GNUTLS_X509_FMT_PEM,
521 out_buf, /* Export to our new buffer */ 521 out_buf, /* Export to our new buffer */

mercurial