diff options
author | Günther Deschner <gd@samba.org> | 2008-09-20 17:00:30 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-09-21 22:30:10 +0200 |
commit | 1f9624175ab35fe5c4012e931a165d422bf26fdb (patch) | |
tree | 683dafcaff69c1538b164f483b812fae43066978 | |
parent | 2331c96d28fe713d37b421924e610eef80cc8d91 (diff) | |
download | samba-1f9624175ab35fe5c4012e931a165d422bf26fdb.tar.gz samba-1f9624175ab35fe5c4012e931a165d422bf26fdb.tar.bz2 samba-1f9624175ab35fe5c4012e931a165d422bf26fdb.zip |
netlogon: add init_netr_CryptPassword.
Guenther
-rw-r--r-- | source3/include/proto.h | 3 | ||||
-rw-r--r-- | source3/rpc_client/init_netlogon.c | 17 |
2 files changed, 20 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 2901911c70..bec5f10f3c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -7427,6 +7427,9 @@ void init_netr_PasswordInfo(struct netr_PasswordInfo *r, const char *workstation, struct samr_Password lmpassword, struct samr_Password ntpassword); +void init_netr_CryptPassword(const char *pwd, + unsigned char session_key[16], + struct netr_CryptPassword *pwd_buf); /* The following definitions come from rpc_client/init_samr.c */ diff --git a/source3/rpc_client/init_netlogon.c b/source3/rpc_client/init_netlogon.c index 61841953fc..e4c39e739e 100644 --- a/source3/rpc_client/init_netlogon.c +++ b/source3/rpc_client/init_netlogon.c @@ -391,3 +391,20 @@ void init_netr_PasswordInfo(struct netr_PasswordInfo *r, r->lmpassword = lmpassword; r->ntpassword = ntpassword; } + +/************************************************************************* + inits a netr_CryptPassword structure + *************************************************************************/ + +void init_netr_CryptPassword(const char *pwd, + unsigned char session_key[16], + struct netr_CryptPassword *pwd_buf) +{ + struct samr_CryptPassword password_buf; + + encode_pw_buffer(password_buf.data, pwd, STR_UNICODE); + + SamOEMhash(password_buf.data, session_key, 516); + memcpy(pwd_buf->data, password_buf.data, 512); + pwd_buf->length = IVAL(password_buf.data, 512); +} |