backupkey: Use ndr_pull_struct_blob_all()
authorAndrew Bartlett <abartlet@samba.org>
Fri, 20 Mar 2015 01:32:00 +0000 (14:32 +1300)
committerKarolin Seeger <kseeger@samba.org>
Wed, 8 Apr 2015 21:43:18 +0000 (23:43 +0200)
commit903dfd6c804bd37bba3cc480f8d6364fdc9358ed
tree6ae5f08600085349f395a1454093e08007eab966
parent1dca6ee61be33617351315b6865ea23e7c238e77
backupkey: Use ndr_pull_struct_blob_all()

This avoids bad decrypts from falling down to later code and getting
the error code wrong, by strictly requiring the NDR parse to use all the
data.  A bad decyrpt is very unlikely to get the length correct, and
so fall down to the other checks.

This should fix:
UNEXPECTED(failure): samba4.rpc.backupkey with seal.backupkey.server_wrap_decrypt_wrong_r2(ad_dc_ntvfs)
REASON: Exception: Exception: ../source4/torture/rpc/backupkey.c:1926: r.out.result was WERR_INVALID_ACCESS, expected WERR_INVALID_PARAM: decrypt should fail with WERR_INVALID_PARAM

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11174
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
(cherry picked from commit e617e3e74b7ea13bcf3ce385f3926e50e38dbe44)
source4/rpc_server/backupkey/dcesrv_backupkey.c