auth/gensec: add GENSEC_UPDATE_IS_NTERROR() helper macro
authorStefan Metzmacher <metze@samba.org>
Wed, 14 Jun 2017 08:39:26 +0000 (10:39 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 17 Jun 2017 14:48:11 +0000 (16:48 +0200)
This allows us to write clearer code that
checks for NT_STATUS_OK and NT_STATUS_MORE_PROCESSING_REQUIRED.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
auth/gensec/gensec.h

index da3e0fdf31d8e5b18a91a4340b626fad36f881f4..a466f27b7564d7285a3543994b38074c8844e2a7 100644 (file)
@@ -147,6 +147,12 @@ struct tevent_req *gensec_update_send(TALLOC_CTX *mem_ctx,
                                      struct gensec_security *gensec_security,
                                      const DATA_BLOB in);
 NTSTATUS gensec_update_recv(struct tevent_req *req, TALLOC_CTX *out_mem_ctx, DATA_BLOB *out);
+
+#define GENSEC_UPDATE_IS_NTERROR(status) ( \
+       !NT_STATUS_IS_OK(status) && \
+       !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED) \
+       )
+
 /**
  * @brief Ask for features for a following authentication
  *