/*++ /* NAME /* tls_scache 3 /* SUMMARY /* TLS session cache manager /* SYNOPSIS /* #include <tls_scache.h> /* /* TLS_SCACHE *tls_scache_open(dbname, cache_label, verbose, timeout) /* const char *dbname /* const char *cache_label; /* int verbose; /* int timeout; /* /* void tls_scache_close(cache) /* TLS_SCACHE *cache; /* /* int tls_scache_lookup(cache, cache_id, out_session) /* TLS_SCACHE *cache; /* const char *cache_id; /* VSTRING *out_session; /* /* int tls_scache_update(cache, cache_id, session, session_len) /* TLS_SCACHE *cache; /* const char *cache_id; /* const char *session; /* ssize_t session_len; /* /* int tls_scache_sequence(cache, first_next, out_cache_id, /* VSTRING *out_session) /* TLS_SCACHE *cache; /* int first_next; /* char **out_cache_id; /* VSTRING *out_session; /* /* int tls_scache_delete(cache, cache_id) /* TLS_SCACHE *cache; /* const char *cache_id; /* /* TLS_TICKET_KEY *tls_scache_key(keyname, now, timeout) /* unsigned char *keyname; /* time_t now; /* int timeout; /* /* TLS_TICKET_KEY *tls_scache_key_rotate(newkey) /* TLS_TICKET_KEY *newkey; /* DESCRIPTION /* This module maintains Postfix TLS session cache files. /* each session is stored under a lookup key (hostname or /* session ID). /* /* tls_scache_open() opens the specified TLS session cache /* and returns a handle that must be used for subsequent /* access. /* /* tls_scache_close() closes the specified TLS session cache /* and releases memory that was allocated by tls_scache_open(). /* /* tls_scache_lookup() looks up the specified session in the /* specified cache, and applies session timeout restrictions. /* Entries that are too old are silently deleted. /* /* tls_scache_update() updates the specified TLS session cache /* with the specified session information. /* /* tls_scache_sequence() iterates over the specified TLS session /* cache and either returns the first or next entry that has not /* timed out, or returns no data. Entries that are too old are /* silently deleted. Specify TLS_SCACHE_SEQUENCE_NOTHING as the /* third and last argument to disable saving of cache entry /* content or cache entry ID information. This is useful when /* purging expired entries. A result value of zero means that /* the end of the cache was reached. /* /* tls_scache_delete() removes the specified cache entry from /* the specified TLS session cache. /* /* tls_scache_key() locates a TLS session ticket key in a 2-element /* in-memory cache. A null result is returned if no unexpired matching /* key is found. /* /* tls_scache_key_rotate() saves a TLS session tickets key in the /* in-memory cache. /* /* Arguments: /* .IP dbname /* The base name of the session cache file. /* .IP cache_label /* A string that is used in logging and error messages. /* .IP verbose /* Do verbose logging of cache operations? (zero == no) /* .IP timeout /* The time after which a session cache entry is considered too old. /* .IP first_next /* One of DICT_SEQ_FUN_FIRST (first cache element) or DICT_SEQ_FUN_NEXT /* (next cache element). /* .IP cache_id /* Session cache lookup key. /* .IP session /* Storage for session information. /* .IP session_len /* The size of the session information in bytes. /* .IP out_cache_id /* .IP out_session /* Storage for saving the cache_id or session information of the /* current cache entry. /* /* Specify TLS_SCACHE_DONT_NEED_CACHE_ID to avoid saving /* the session cache ID of the cache entry. /* /* Specify TLS_SCACHE_DONT_NEED_SESSION to avoid /* saving the session information in the cache entry. /* .IP keyname /* Is null when requesting the current encryption keys. Otherwise, /* keyname is a pointer to an array of TLS_TICKET_NAMELEN unsigned /* chars (not NUL terminated) that is an identifier for a key /* previously used to encrypt a session ticket. /* .IP now /* Current epoch time passed by caller. /* .IP timeout /* TLS session ticket encryption lifetime. /* .IP newkey /* TLS session ticket key obtained from tlsmgr(8) to be added to *internalcache. /* DIAGNOSTICS /* These routines terminate with a fatal run-time error /* for unrecoverable database errors. This allows the /* program to restart and reset the database to an /* empty initial state. /* /* tls_scache_open() never returns on failure. All other /* functions return non-zero on success, zero when the /* operation could not be completed. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA
/*--*/
/* *Sanitychecks.
*/ if (dict->update == 0)
msg_fatal("dictionary %s does not support update operations", dbname); if (dict->delete == 0)
msg_fatal("dictionary %s does not support delete operations", dbname); if (dict->sequence == 0)
msg_fatal("dictionary %s does not support sequence operations", dbname);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.