summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-08-25 00:04:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:18 -0500
commitc58b64b7bfc9cab1a50c0b848b4fde310d12ddd0 (patch)
tree4364e95f12227ad2259846d6eae0a753aabbe13e /source4
parent53415ebf8a6affb08d65cd3b4edc0e55f68b83d7 (diff)
downloadsamba-c58b64b7bfc9cab1a50c0b848b4fde310d12ddd0.tar.gz
samba-c58b64b7bfc9cab1a50c0b848b4fde310d12ddd0.tar.bz2
samba-c58b64b7bfc9cab1a50c0b848b4fde310d12ddd0.zip
r2031: add a check for a blank secret return in lsa secret tests
(This used to be commit eddb31d19654853189d1c3c52105a6240d100456)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/lsa.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index bf18f48e58..5279393d59 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -463,18 +463,23 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p,
ret = False;
}
- blob1.data = r4.out.new_val->buf->data;
- blob1.length = r4.out.new_val->buf->length;
+ if (r4.out.new_val->buf == NULL) {
+ printf("No secret buffer returned\n");
+ ret = False;
+ } else {
+ blob1.data = r4.out.new_val->buf->data;
+ blob1.length = r4.out.new_val->buf->length;
- blob2 = data_blob(NULL, blob1.length);
+ blob2 = data_blob(NULL, blob1.length);
- secret2 = sess_decrypt_string(&blob1, &session_key);
+ secret2 = sess_decrypt_string(&blob1, &session_key);
- printf("returned secret '%s'\n", secret2);
+ printf("returned secret '%s'\n", secret2);
- if (strcmp(secret1, secret2) != 0) {
- printf("Returned secret doesn't match\n");
- ret = False;
+ if (strcmp(secret1, secret2) != 0) {
+ printf("Returned secret doesn't match\n");
+ ret = False;
+ }
}
if (!test_Delete(p, mem_ctx, &sec_handle)) {