smb_crypt.c (156326) | smb_crypt.c (161523) |
---|---|
1/*- 2 * Copyright (c) 2000-2001, Boris Popov 3 * All rights reserved. 4 * 5 * Copyright (c) 2003, 2004 Tim J. Robbins. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 */ 35 36#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2000-2001, Boris Popov 3 * All rights reserved. 4 * 5 * Copyright (c) 2003, 2004 Tim J. Robbins. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 */ 35 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sys/netsmb/smb_crypt.c 156326 2006-03-05 22:52:17Z yar $"); | 37__FBSDID("$FreeBSD: head/sys/netsmb/smb_crypt.c 161523 2006-08-22 03:05:51Z marcel $"); |
38 39#include <sys/param.h> 40#include <sys/malloc.h> 41#include <sys/kernel.h> 42#include <sys/systm.h> 43#include <sys/conf.h> 44#include <sys/proc.h> 45#include <sys/fcntl.h> --- 190 unchanged lines hidden (view full) --- 236 */ 237 KASSERT(rqp->sr_t2 == NULL || 238 (rqp->sr_t2->t2_flags & SMBT2_SECONDARY) == 0 || 239 rqp->sr_t2->t2_rq == rqp, 240 ("sec t2 rq not using same smb_rq")); 241 } 242 243 /* Initialize sec. signature field to sequence number + zeros. */ | 38 39#include <sys/param.h> 40#include <sys/malloc.h> 41#include <sys/kernel.h> 42#include <sys/systm.h> 43#include <sys/conf.h> 44#include <sys/proc.h> 45#include <sys/fcntl.h> --- 190 unchanged lines hidden (view full) --- 236 */ 237 KASSERT(rqp->sr_t2 == NULL || 238 (rqp->sr_t2->t2_flags & SMBT2_SECONDARY) == 0 || 239 rqp->sr_t2->t2_rq == rqp, 240 ("sec t2 rq not using same smb_rq")); 241 } 242 243 /* Initialize sec. signature field to sequence number + zeros. */ |
244 *(u_int32_t *)rqp->sr_rqsig = htole32(rqp->sr_seqno); 245 *(u_int32_t *)(rqp->sr_rqsig + 4) = 0; | 244 le32enc(rqp->sr_rqsig, rqp->sr_seqno); 245 le32enc(rqp->sr_rqsig + 4, 0); |
246 247 /* 248 * Compute HMAC-MD5 of packet data, keyed by MAC key. 249 * Store the first 8 bytes in the sec. signature field. 250 */ 251 smb_rq_getrequest(rqp, &mbp); 252 MD5Init(&md5); 253 MD5Update(&md5, vcp->vc_mackey, vcp->vc_mackeylen); --- 56 unchanged lines hidden --- | 246 247 /* 248 * Compute HMAC-MD5 of packet data, keyed by MAC key. 249 * Store the first 8 bytes in the sec. signature field. 250 */ 251 smb_rq_getrequest(rqp, &mbp); 252 MD5Init(&md5); 253 MD5Update(&md5, vcp->vc_mackey, vcp->vc_mackeylen); --- 56 unchanged lines hidden --- |