diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-01-06 16:58:52 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-03-24 17:34:52 +0100 |
commit | 3220c84b72212cb7619ecda60dd8a7c756742e3b (patch) | |
tree | 9c38aeb7505f46026cce4fe77bd5c84800dfda83 /source4 | |
parent | e669ee4c9d2b068073187326eb61d1ac751a03af (diff) | |
download | samba-3220c84b72212cb7619ecda60dd8a7c756742e3b.tar.gz samba-3220c84b72212cb7619ecda60dd8a7c756742e3b.tar.bz2 samba-3220c84b72212cb7619ecda60dd8a7c756742e3b.zip |
s4:ntlmssp: use a 'bool ok' helper variable to make the code more readable
metze
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/auth/ntlmssp/ntlmssp_sign.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp_sign.c b/source4/auth/ntlmssp/ntlmssp_sign.c index 50ad2fdd3a..285369dbb3 100644 --- a/source4/auth/ntlmssp/ntlmssp_sign.c +++ b/source4/auth/ntlmssp/ntlmssp_sign.c @@ -114,12 +114,16 @@ static NTSTATUS ntlmssp_make_packet_signature(struct ntlmssp_state *ntlmssp_stat (unsigned long long)pdu_length)); dump_data(11, sig->data, sig->length); } else { + bool ok; uint32_t crc; crc = crc32_calc_buffer(data, length); - if (!msrpc_gen(sig_mem_ctx, - sig, "dddd", NTLMSSP_SIGN_VERSION, 0, - crc, ntlmssp_state->crypt.ntlm.seq_num)) { + + ok = msrpc_gen(sig_mem_ctx, + sig, "dddd", + NTLMSSP_SIGN_VERSION, 0, crc, + ntlmssp_state->crypt.ntlm.seq_num); + if (!ok) { return NT_STATUS_NO_MEMORY; } ntlmssp_state->crypt.ntlm.seq_num++; @@ -264,12 +268,16 @@ NTSTATUS ntlmssp_seal_packet(struct ntlmssp_state *ntlmssp_state, sig->data+4, 8); } } else { + bool ok; uint32_t crc; crc = crc32_calc_buffer(data, length); - if (!msrpc_gen(sig_mem_ctx, - sig, "dddd", NTLMSSP_SIGN_VERSION, 0, - crc, ntlmssp_state->crypt.ntlm.seq_num)) { + + ok = msrpc_gen(sig_mem_ctx, + sig, "dddd", + NTLMSSP_SIGN_VERSION, 0, crc, + ntlmssp_state->crypt.ntlm.seq_num); + if (!ok) { return NT_STATUS_NO_MEMORY; } |