Added STS profile persistence and policy parsing/enforcement (including load/save, upgrades, and expiry rescheduling) to the STS module.

Integrated STS capability handling and connection lifecycle hooks (ignore CAP DEL, trigger upgrades, reschedule on disconnect, new server fields).
Initialized and cleaned up STS state during startup/shutdown to persist policies across sessions.
This commit is contained in:
2026-01-25 17:20:53 -07:00
parent 4d6c77704c
commit a0f0c48bc5
6 changed files with 552 additions and 9 deletions

View File

@@ -24,20 +24,30 @@
G_BEGIN_DECLS
struct server;
typedef struct sts_profile
{
char *host;
guint16 port;
time_t expires_at;
guint64 duration;
gboolean preload;
} sts_profile;
sts_profile *sts_profile_new (const char *host, guint16 port, time_t expires_at, gboolean preload);
sts_profile *sts_profile_new (const char *host, guint16 port, time_t expires_at, guint64 duration, gboolean preload);
void sts_profile_free (sts_profile *profile);
char *sts_profile_serialize (const sts_profile *profile);
sts_profile *sts_profile_deserialize (const char *serialized);
void sts_init (void);
void sts_save (void);
void sts_cleanup (void);
gboolean sts_apply_policy_for_connection (struct server *serv, const char *hostname, int *port);
gboolean sts_handle_capability (struct server *serv, const char *value);
void sts_reschedule_on_disconnect (struct server *serv);
G_END_DECLS
#endif