Home GnuPG

New macro ntbtls_check_context.

Description

New macro ntbtls_check_context.

* src/ntbtls.h.in (ntbtls_check_context): New macro.
* src/visibility.c (_ntbtls_check_context): New function.
* src/libntbtls.def, src/libntbtls.vers: Add _ntbtls_check_context.
* configure.ac (SIZEOF_UNSIGNED_LONG): Define.
* src/context.h (NTBTLS_CONTEXT_MAGIC): New constant.
(_ntbtls_context_s): New field 'magic'.
* src/debug.c (_ntbtls_debug_bug): Always print a message.
* src/protocol.c (_ntbtls_new): Set MAGIC.
(_ntbtls_release): Test MAGIC.

This macro allows to assert that a TLS context, which might have been
conveyed using an opaque pointer, is valid. The function does not
abort but merely logs and returns error.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Feb 21 2017, 11:05 AM
Parents
rT59b779b8c0f7: New function ntbtls_get_hostname.
Branches
Unknown
Tags
Unknown