dirmngr: Add a magic field to the http structs.
authorWerner Koch <wk@gnupg.org>
Tue, 21 Feb 2017 08:12:00 +0000 (09:12 +0100)
committerWerner Koch <wk@gnupg.org>
Tue, 21 Feb 2017 08:13:02 +0000 (09:13 +0100)
commit39c745038181edd097e188434b3f9c971ed3987f
tree2b8e2a4c401216bee1f457d19391ed2c04dbbf3c
parent3fc69224b7b22ad1df1395ebcb21549384839cd1
dirmngr: Add a magic field to the http structs.

* dirmngr/http.c (HTTP_SESSION_MAGIC): New.
(http_session_s): New field 'magic'.
(HTTP_CONTEXT_MAGIC): New.
(http_context_s): New field 'magic'.
(my_ntbtls_verify_cb): Assert MAGIC.
(fp_onclose_notification): Ditto.
(session_unref): Ditto.  Reset MAGIC.
(http_session_new): Set MAGIC.
(http_open): Ditto.
(http_raw_connect): Ditto.
(http_close): Assert MAGIC.  Reset MAGIC.

* dirmngr/t-http.c (my_http_tls_verify_cb): MArk HTTP_FLAGS unused.
--

We pass those handles through opaque pointers.  The magic numbers will
help to detect wrong use.

Signed-off-by: Werner Koch <wk@gnupg.org>
dirmngr/http.c
dirmngr/t-http.c