You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libsxmp/man/sxhub_set_sslvalidate.3

70 lines
1.8 KiB
Groff

9 years ago
.TH SXHUB_SET_SSLVALIDATE 3 "20 July 2015" "SXMP" "SXMP Library Manual"
9 years ago
.SH NAME
sxhub_set_sslvalidate \- Set callback for the links created on the pointed hub, called to validate x.509 certificate of peer by serial number.
9 years ago
.br
.SH SYNOPSIS
9 years ago
.B #include <sxmp/sxmp.h>
9 years ago
.sp
9 years ago
#define sxhub_set_sslvalidate(c, f)
9 years ago
.br
.sp
.SH DESCRIPTION
This macro should be used if you want to setup callback function fired while connection link initiating, and depending on returning value will establish link or destroy it.
.br
This macro will set on
.B c
connections link set callback
.B f
which is a function pointer of the type:
.br
.sp
.B typedef int (*validate_sslpem_t)(sxlink_t *);
9 years ago
.br
.sp
It will pass a pointer to the connection link initiating now. Link isn't set fully at this moment and doesn't pass any messages and don't works with channel's operations. To pass initiation to the next stage this function should return
.B 0.
9 years ago
In fail case other code error should be returned.
.SH RETURN VALUE
None.
.SH ERRORS
None.
.SH BUGS
None known yet.
.SH EXAMPLE
This example shows the code prototype for the simple check:
.RS
.nf
.if t .ft CW
int validatex509(sxlink_t *co)
{
sxsession_ctx_t *ctx = sxlink_getpctx(co);
uint64_t x509serial = ctx->certid;
/* do checks ... */
/* your fail case */return 1;
return 0; /* all is fine */
}
9 years ago
.SH APPLICATION USAGE
This function should be used on the master service, currently it's not applicable for client applications, and may cause undefined behavoir.
9 years ago
.SH RATIONALE
None.
.SH SEE ALSO
9 years ago
.BI sxhub_set_priv(3)
9 years ago
,
9 years ago
.BI sxhub_get_priv(3)
9 years ago
,
9 years ago
.BI sxhub_set_ondestroy(3)
9 years ago
,
.BI sxlink_getpctx(3)
9 years ago
,
.BI sxlink_getpriv(3)
9 years ago
,
.BI sxlink_setpriv(3)
9 years ago
.SH COPYRIGHT
This software licensed under GNU LGPL v3. See COPYING for further details.
9 years ago
.br
(c) Askele Group 2013-2015 <http://askele.com>
.SH AUTHOR
Alexander Vdolainen (vdo@askele.com)