Changeset 587 for vendor/current/libcli


Ignore:
Timestamp:
Jun 29, 2011, 7:36:41 AM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update vendor to version 3.5.6

Location:
vendor/current/libcli/auth
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/libcli/auth/credentials.c

    r414 r587  
    2525#include "../lib/crypto/crypto.h"
    2626#include "libcli/auth/libcli_auth.h"
     27#include "../libcli/security/dom_sid.h"
    2728
    2829static void netlogon_creds_step_crypt(struct netlogon_creds_CredentialState *creds,
     
    203204                                                                  uint32_t negotiate_flags)
    204205{
    205         struct netlogon_creds_CredentialState *creds = talloc(mem_ctx, struct netlogon_creds_CredentialState);
     206        struct netlogon_creds_CredentialState *creds = talloc_zero(mem_ctx, struct netlogon_creds_CredentialState);
    206207       
    207208        if (!creds) {
     
    454455}       
    455456
     457/*
     458  copy a netlogon_creds_CredentialState struct
     459*/
     460
     461struct netlogon_creds_CredentialState *netlogon_creds_copy(TALLOC_CTX *mem_ctx,
     462                                                           struct netlogon_creds_CredentialState *creds_in)
     463{
     464        struct netlogon_creds_CredentialState *creds = talloc_zero(mem_ctx, struct netlogon_creds_CredentialState);
     465
     466        if (!creds) {
     467                return NULL;
     468        }
     469
     470        creds->sequence                 = creds_in->sequence;
     471        creds->negotiate_flags          = creds_in->negotiate_flags;
     472        creds->secure_channel_type      = creds_in->secure_channel_type;
     473
     474        creds->computer_name = talloc_strdup(creds, creds_in->computer_name);
     475        if (!creds->computer_name) {
     476                talloc_free(creds);
     477                return NULL;
     478        }
     479        creds->account_name = talloc_strdup(creds, creds_in->account_name);
     480        if (!creds->account_name) {
     481                talloc_free(creds);
     482                return NULL;
     483        }
     484
     485        if (creds_in->sid) {
     486                creds->sid = dom_sid_dup(creds, creds_in->sid);
     487                if (!creds->sid) {
     488                        talloc_free(creds);
     489                        return NULL;
     490                }
     491        }
     492
     493        memcpy(creds->session_key, creds_in->session_key, sizeof(creds->session_key));
     494        memcpy(creds->seed.data, creds_in->seed.data, sizeof(creds->seed.data));
     495        memcpy(creds->client.data, creds_in->client.data, sizeof(creds->client.data));
     496        memcpy(creds->server.data, creds_in->server.data, sizeof(creds->server.data));
     497
     498        return creds;
     499}
  • vendor/current/libcli/auth/proto.h

    r414 r587  
    3636bool netlogon_creds_client_check(struct netlogon_creds_CredentialState *creds,
    3737                        const struct netr_Credential *received_credentials);
     38struct netlogon_creds_CredentialState *netlogon_creds_copy(TALLOC_CTX *mem_ctx,
     39                                                           struct netlogon_creds_CredentialState *creds_in);
    3840
    3941/*****************************************************************
Note: See TracChangeset for help on using the changeset viewer.