summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc/dcerpc.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-06-07 12:30:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:36 -0500
commitc0871cb0c13599039f4e8243bd8d60d472653930 (patch)
treed8f1908ed723d9d78060aa4bfb105795c7421918 /source4/librpc/rpc/dcerpc.h
parent6564fd402d500b1e24f76f63e4335b38ef1164db (diff)
downloadsamba-c0871cb0c13599039f4e8243bd8d60d472653930.tar.gz
samba-c0871cb0c13599039f4e8243bd8d60d472653930.tar.bz2
samba-c0871cb0c13599039f4e8243bd8d60d472653930.zip
r1068: make the dcerpc client side auth/crypto code much more generic
metze (This used to be commit 1706ff88a72c6578a109c2cf24f2f009812c3892)
Diffstat (limited to 'source4/librpc/rpc/dcerpc.h')
-rw-r--r--source4/librpc/rpc/dcerpc.h46
1 files changed, 30 insertions, 16 deletions
diff --git a/source4/librpc/rpc/dcerpc.h b/source4/librpc/rpc/dcerpc.h
index 7bd6f98118..7694a9c230 100644
--- a/source4/librpc/rpc/dcerpc.h
+++ b/source4/librpc/rpc/dcerpc.h
@@ -25,24 +25,39 @@ enum dcerpc_transport_t {NCACN_NP, NCACN_IP_TCP};
/*
this defines a generic security context for signed/sealed dcerpc pipes.
*/
-struct dcerpc_security {
- void *private;
- NTSTATUS (*unseal_packet)(struct dcerpc_security *,
- TALLOC_CTX *mem_ctx,
- uint8_t *data, size_t length, DATA_BLOB *sig);
- NTSTATUS (*check_packet)(struct dcerpc_security *,
- TALLOC_CTX *mem_ctx,
- const uint8_t *data, size_t length, const DATA_BLOB *sig);
- NTSTATUS (*seal_packet)(struct dcerpc_security *,
- TALLOC_CTX *mem_ctx,
+struct dcerpc_security;
+struct dcerpc_pipe;
+
+struct dcerpc_user {
+ const char *domain;
+ const char *name;
+ const char *password;
+};
+
+struct dcesrv_security_ops {
+ const char *name;
+ uint8 auth_type;
+ NTSTATUS (*start)(struct dcerpc_pipe *dce_pipe, struct dcerpc_security *dce_sec);
+ NTSTATUS (*update)(struct dcerpc_security *dce_sec, TALLOC_CTX *out_mem_ctx,
+ const DATA_BLOB in, DATA_BLOB *out);
+ NTSTATUS (*seal)(struct dcerpc_security *dce_sec, TALLOC_CTX *sig_mem_ctx,
uint8_t *data, size_t length, DATA_BLOB *sig);
- NTSTATUS (*sign_packet)(struct dcerpc_security *,
- TALLOC_CTX *mem_ctx,
+ NTSTATUS (*sign)(struct dcerpc_security *dce_sec, TALLOC_CTX *sig_mem_ctx,
const uint8_t *data, size_t length, DATA_BLOB *sig);
+ NTSTATUS (*check_sig)(struct dcerpc_security *dce_sec, TALLOC_CTX *sig_mem_ctx,
+ const uint8_t *data, size_t length, const DATA_BLOB *sig);
+ NTSTATUS (*unseal)(struct dcerpc_security *dce_sec, TALLOC_CTX *sig_mem_ctx,
+ uint8_t *data, size_t length, DATA_BLOB *sig);
NTSTATUS (*session_key)(struct dcerpc_security *, DATA_BLOB *session_key);
- void (*security_end)(struct dcerpc_security *);
+ void (*end)(struct dcerpc_security *dce_sec);
+};
+
+struct dcerpc_security {
+ struct dcerpc_auth *auth_info;
+ struct dcerpc_user user;
+ void *private_data;
+ const struct dcesrv_security_ops *ops;
};
-
struct dcerpc_pipe {
TALLOC_CTX *mem_ctx;
@@ -51,8 +66,7 @@ struct dcerpc_pipe {
uint32_t srv_max_xmit_frag;
uint32_t srv_max_recv_frag;
uint_t flags;
- struct dcerpc_security *security_state;
- struct dcerpc_auth *auth_info;
+ struct dcerpc_security security_state;
const char *binding_string;
struct dcerpc_transport {