Re: (no subject)
[email protected] (Jonas Borgström) 15 Dec 2002 00:31:50 +0100
| Newsgroups | gmane.network.beep.roadrunner.general |
|---|---|
| Message-ID | <[email protected]> |
Sandro Poppi <[email protected]> writes: > Hi again, >=20 > I tried to write such a profile (I called it FORCE ;) but I found that > using server_init is not sufficient because it is called after a start > request of a client is received for the profile. But if a client does > not support the force profile it will never be called and thus - > assuming the server accepts other profiles - the client can start a > session using server supported profiles. >=20 Hi, I'm assuming that you want your server to only allow connecting clients to start an IDXP channel if the connection has been tuned for TLS encryption.=20 It isn't enough just to check if the client supports the TLS profile you have to check if encryption has been enabled (rr_tls_privatize has been called). The best way is if the profile on the server side can be configured to only accept encrypted connection. But with profiles which doesn't=20 support this (like IDXP) you can do as Francis suggested. Create a new profile (MyIDXP) that extends RRIDXP and just overrides the server_init function. It shouldn't do anything more like changing the profile identification URI or overriding some other functions. Your modified server_init function should look something like this: static gboolean server_init (RRChannel *channel, const gchar *piggyback, GError **error) { /* Make sure the connection is encrypted */ if (rr_tls_is_strong_enough (rr_channel_get_connection (channel), 128) =3D=3D FALSE) { /* if not, return FALSE so the channel start-up is aborted = */ g_set_error (error, RR_BEEP_ERROR,=20 RR_BEEP_CODE_ACTION_NOT_TAKEN, "Use TLS!"); return FALSE; } /* Call the super class version of this function */ return RR_TLS_CLASS (parent_class)->server_init (channel, piggyback= ,=20 error); } > What I'm now thinking of is to extend rr_init to check for required > profiles. >=20 rr_init initializes the RoadRunner library. This is probably not the right place to check for required profiles. > What do you think of such a solution? What are the pros and cons from > your point of view? Or is there another solution for this problem I > didn't think of yet? >=20 See the above. > Any other comments? (Of course I would publish the patches on this list > if I do it this way so Codefactory may incorporate them into the rr > distribution ;) >=20 It depends. A patch to make the IDXP profile configurable to only allow new channels when the connection has been tuned for encryption is appreciated. / Jonas --=20 Jonas Borgstr=F6m [email protected] CodeFactory AB http://www.codefactory.se/ Office: +46 (0)90 71 86 14