1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

remove: ss plugins

These have been disabled via a preprocessor symbol with no UI to enable it
for a year or so, it looks like they are not going to be needed.

The model of in-tree auth selectable from cmake looks like it will do for
everything, or if not, the solution will probably look different to this.
This commit is contained in:
Andy Green 2021-10-10 08:54:49 +01:00
parent f5edf9d75a
commit 3ae573cf9b
5 changed files with 3 additions and 91 deletions

View file

@ -51,32 +51,6 @@ typedef int (*plugin_auth_status_cb)(struct lws_ss_handle *ss, int status);
* has the LWSSSPOLF_NAILED_UP flag.
*/
#if defined(LWS_WITH_SSPLUGINS)
typedef struct lws_ss_plugin {
struct lws_ss_plugin *next;
const char *name; /**< auth plugin name */
size_t alloc; /**< size of private allocation */
int (*create)(struct lws_ss_handle *ss, void *info,
plugin_auth_status_cb status);
/**< called when the auth plugin is instantiated
and bound to the secure stream. status is
called back with advisory information about
the authenticated stream state as it
proceeds */
int (*destroy)(struct lws_ss_handle *ss);
/**< called when the related secure stream is
being destroyed, and anything the auth
plugin is doing should also be destroyed */
int (*munge)(struct lws_ss_handle *ss, char *path,
size_t path_len);
/**< if the plugin needs to munge transactions
that have metadata outside the payload (eg,
add http headers) this callback will give
it the opportunity to do so */
} lws_ss_plugin_t;
#endif
/* the public, const metrics policy definition */
typedef struct lws_metric_policy {
@ -331,12 +305,6 @@ typedef struct lws_ss_policy {
/* details for non-http related protocols... */
} u;
#if defined(LWS_WITH_SSPLUGINS)
const
struct lws_ss_plugin *plugins[2]; /**< NULL or auth plugin */
const void *plugins_info[2]; /**< plugin-specific data */
#endif
#if defined(LWS_WITH_SECURE_STREAMS_AUTH_SIGV4)
/* directly point to the metadata name, no need to expand */
const char *aws_region;

View file

@ -849,9 +849,6 @@ lws_create_context(const struct lws_context_creation_info *info)
#if !defined(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY)
context->pss_policies_json = info->pss_policies_json;
#endif
#if defined(LWS_WITH_SSPLUGINS)
context->pss_plugins = info->pss_plugins;
#endif
#endif
/* if he gave us names, set the uid / gid */

View file

@ -305,9 +305,6 @@ static signed char
lws_ss_policy_parser_cb(struct lejp_ctx *ctx, char reason)
{
struct policy_cb_args *a = (struct policy_cb_args *)ctx->user;
#if defined(LWS_WITH_SSPLUGINS)
const lws_ss_plugin_t **pin;
#endif
char **pp, dotstar[32], *q;
lws_ss_trust_store_t *ts;
lws_ss_metadata_t *pmd;
@ -701,29 +698,8 @@ lws_ss_policy_parser_cb(struct lejp_ctx *ctx, char reason)
pp = (char **)&a->curr[LTY_POLICY].p->payload_fmt;
goto string2;
case LSSPPT_PLUGINS:
#if defined(LWS_WITH_SSPLUGINS)
pin = a->context->pss_plugins;
if (a->count ==
(int)LWS_ARRAY_SIZE(a->curr[LTY_POLICY].p->plugins)) {
lwsl_err("%s: too many plugins\n", __func__);
goto oom;
}
if (!pin)
break;
while (*pin) {
if (!strncmp((*pin)->name, ctx->buf, ctx->npos)) {
a->curr[LTY_POLICY].p->plugins[a->count++] = *pin;
return 0;
}
pin++;
}
lwsl_err("%s: unknown plugin\n", __func__);
goto oom;
#else
case LSSPPT_PLUGINS: /* deprecated */
break;
#endif
case LSSPPT_TLS:
if (reason == LEJPCB_VAL_TRUE)

View file

@ -80,11 +80,6 @@ typedef struct lws_ss_handle {
struct lws_sss_proxy_conn *conn_if_sspc_onw;
#if defined(LWS_WITH_SSPLUGINS)
void *nauthi; /**< the nauth plugin instance data */
void *sauthi; /**< the sauth plugin instance data */
#endif
lws_ss_metadata_t *metadata;
#if defined(LWS_WITH_SS_DIRECT_PROTOCOL_STR)
lws_ss_metadata_t *instant_metadata; /**< for set instant metadata */

View file

@ -845,11 +845,6 @@ _lws_ss_client_connect(lws_ss_handle_t *h, int is_retry, void *conn_if_sspc_onw)
i.pwsi = &h->wsi;
#if defined(LWS_WITH_SSPLUGINS)
if (h->policy->plugins[0] && h->policy->plugins[0]->munge)
h->policy->plugins[0]->munge(h, path, h->context->max_http_header_data);
#endif
lwsl_info("%s: connecting %s, '%s' '%s' %s\n", __func__, i.method,
i.alpn, i.address, i.path);
@ -1009,22 +1004,14 @@ lws_ss_create(struct lws_context *context, int tsi, const lws_ss_info_t *ssi,
* We overallocate and point to things in the overallocation...
*
* 1) the user_alloc from the stream info
* 2) network auth plugin instantiation data
* 3) stream auth plugin instantiation data
* 4) as many metadata pointer structs as the policy tells
* 5) the streamtype name (length is not aligned)
* 2) as many metadata pointer structs as the policy tells
* 3) the streamtype name (length is not aligned)
*
* ... when we come to destroy it, just one free to do.
*/
size = sizeof(*h) + ssi->user_alloc +
(ssi->streamtype ? strlen(ssi->streamtype): 0) + 1;
#if defined(LWS_WITH_SSPLUGINS)
if (pol->plugins[0])
size += pol->plugins[0]->alloc;
if (pol->plugins[1])
size += pol->plugins[1]->alloc;
#endif
size += pol->metadata_count * sizeof(lws_ss_metadata_t);
h = lws_zalloc(size, __func__);
@ -1074,17 +1061,6 @@ lws_ss_create(struct lws_context *context, int tsi, const lws_ss_info_t *ssi,
p += ssi->user_alloc;
#if defined(LWS_WITH_SSPLUGINS)
if (pol->plugins[0]) {
h->nauthi = p;
p += pol->plugins[0]->alloc;
}
if (pol->plugins[1]) {
h->sauthi = p;
p += pol->plugins[1]->alloc;
}
#endif
if (pol->metadata_count) {
h->metadata = (lws_ss_metadata_t *)p;
p += pol->metadata_count * sizeof(lws_ss_metadata_t);