src/ssl_sock.c
static int
ssl_sock_get_serial(X509 *crt, struct chunk *out)
{
	ASN1_INTEGER *serial;

	serial = X509_get_serialNumber(crt);
	if (!serial)
		return 0;

	if (out->size < serial->length)
		return -1;

	memcpy(out->str, serial->data, serial->length);
	out->len = serial->length;
	return 1;
}
/* Extract a serial from a cert, and copy it to a chunk.
 * Returns 1 if serial is found and copied, 0 if no serial found and
 * -1 if output is not large enough.
 */
Extract a serial from a cert, and copy it to a chunk.
Returns 1 if serial is found and copied, 0 if no serial found and
-1 if output is not large enough.
Extract a serial from a cert and copy it to a chunk . Returns 1 if serial is found and copied 0 if no serial found and - 1 if output is not large enough .
static int
ssl_sock_get_serial(X509 *crt, struct chunk *out)
{
	ASN1_INTEGER *serial;
	serial = X509_get_serialNumber(crt);
	if (!serial)
		return 0;
	if (out->size < serial->length)
		return -1;
	memcpy(out->str, serial->data, serial->length);
	out->len = serial->length;
	return 1;
}
static int ssl_sock_get_serial ( X509 * crt , struct chunk * out ) { ASN1_INTEGER * serial ; serial = X509_get_serialNumber ( crt ) ; if ( ! serial ) return 0 ; if ( out -> size < serial -> length ) return -1 ; memcpy ( out -> str , serial -> data , serial -> length ) ; out -> len = serial -> length ; return 1 ; }
Extract a serial from a cert, and copy it to a chunk.
Extract a serial from a cert and copy it to a chunk .