diff options
-rw-r--r-- | libcli/auth/schannel_proto.h | 3 | ||||
-rw-r--r-- | libcli/auth/schannel_sign.c | 23 |
2 files changed, 26 insertions, 0 deletions
diff --git a/libcli/auth/schannel_proto.h b/libcli/auth/schannel_proto.h index 0414218614..da7655908e 100644 --- a/libcli/auth/schannel_proto.h +++ b/libcli/auth/schannel_proto.h @@ -28,6 +28,9 @@ struct schannel_state; struct db_context *open_schannel_session_store(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx); +struct schannel_state *netsec_create_state(TALLOC_CTX *mem_ctx, + struct netlogon_creds_CredentialState *creds, + bool initiator); NTSTATUS netsec_incoming_packet(struct schannel_state *state, bool do_unseal, uint8_t *data, size_t length, diff --git a/libcli/auth/schannel_sign.c b/libcli/auth/schannel_sign.c index 6e5d4544af..518a6a90a4 100644 --- a/libcli/auth/schannel_sign.c +++ b/libcli/auth/schannel_sign.c @@ -35,6 +35,29 @@ RSIVAL(_buf, 4, _seq_num_high); \ } while(0) +struct schannel_state *netsec_create_state(TALLOC_CTX *mem_ctx, + struct netlogon_creds_CredentialState *creds, + bool initiator) +{ + struct schannel_state *state; + + state = talloc(mem_ctx, struct schannel_state); + if (state == NULL) { + return NULL; + } + + state->state = SCHANNEL_STATE_UPDATE_1; + state->initiator = initiator; + state->seq_num = 0; + state->creds = netlogon_creds_copy(state, creds); + if (state->creds == NULL) { + talloc_free(state); + return NULL; + } + + return state; +} + static void netsec_offset_and_sizes(struct schannel_state *state, bool do_seal, uint32_t *_min_sig_size, |