STEP01: librpc/rpc/dcerpc_connection.c: add dcerpc_security_get_auth_info
authorStefan Metzmacher <metze@samba.org>
Wed, 22 Jan 2014 10:48:33 +0000 (11:48 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 4 Jun 2019 10:45:39 +0000 (12:45 +0200)
librpc/rpc/dcerpc_connection.c
librpc/rpc/dcerpc_connection.h

index 780f3d2196cf49c16c0411e32d216bf8d16d062c..828c456c6b3462ec6ce68d19f7f30d196eae1505 100644 (file)
@@ -259,6 +259,31 @@ struct dcerpc_security *dcerpc_security_allocate(
        return sec;
 }
 
+void dcerpc_security_get_auth_info(const struct dcerpc_security *sec,
+                                  enum dcerpc_AuthType *auth_type,
+                                  enum dcerpc_AuthLevel *auth_level)
+{
+       enum dcerpc_AuthType _auth_type;
+       enum dcerpc_AuthLevel _auth_level;
+
+       if (auth_type == NULL) {
+               auth_type = &_auth_type;
+       }
+
+       if (auth_level == NULL) {
+               auth_level = &_auth_level;
+       }
+
+       if (sec == NULL) {
+               *auth_type = DCERPC_AUTH_TYPE_NONE;
+               *auth_level = DCERPC_AUTH_LEVEL_NONE;
+               return;
+       }
+
+       *auth_type = sec->auth_type;
+       *auth_level = sec->auth_level;
+}
+
 struct dcerpc_presentation *dcerpc_presentation_allocate(
                                        TALLOC_CTX *mem_ctx,
                                        struct dcerpc_connection *conn,
index aca9700984c50e84f04ec49cb5c82ab0375cef81..477fa399a92e9ed35beb49af62699e84ba12e1b9 100644 (file)
@@ -49,6 +49,9 @@ struct dcerpc_security *dcerpc_security_allocate(
                                        enum dcerpc_AuthType auth_type,
                                        enum dcerpc_AuthLevel auth_level,
                                        struct gensec_security **gensec);
+void dcerpc_security_get_auth_info(const struct dcerpc_security *sec,
+                                  enum dcerpc_AuthType *auth_type,
+                                  enum dcerpc_AuthLevel *auth_level);
 struct dcerpc_presentation *dcerpc_presentation_allocate(
                                        TALLOC_CTX *mem_ctx,
                                        struct dcerpc_connection *conn,