smb_crypt.c (75374) | smb_crypt.c (78064) |
---|---|
1/* 2 * Copyright (c) 2000-2001, Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 2000-2001, Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/netsmb/smb_crypt.c 75374 2001-04-10 07:59:06Z bp $ | 32 * $FreeBSD: head/sys/netsmb/smb_crypt.c 78064 2001-06-11 12:39:29Z ume $ |
33 */ 34#include <sys/param.h> 35#include <sys/malloc.h> 36#include <sys/kernel.h> 37#include <sys/systm.h> 38#include <sys/conf.h> 39#include <sys/proc.h> 40#include <sys/fcntl.h> --- 28 unchanged lines hidden (view full) --- 69 kk[1] = key[0] << 7 | (key[1] >> 1 & 0xfe); 70 kk[2] = key[1] << 6 | (key[2] >> 2 & 0xfe); 71 kk[3] = key[2] << 5 | (key[3] >> 3 & 0xfe); 72 kk[4] = key[3] << 4 | (key[4] >> 4 & 0xfe); 73 kk[5] = key[4] << 3 | (key[5] >> 5 & 0xfe); 74 kk[6] = key[5] << 2 | (key[6] >> 6 & 0xfe); 75 kk[7] = key[6] << 1; 76 ksp = malloc(sizeof(des_key_schedule), M_SMBTEMP, M_WAITOK); | 33 */ 34#include <sys/param.h> 35#include <sys/malloc.h> 36#include <sys/kernel.h> 37#include <sys/systm.h> 38#include <sys/conf.h> 39#include <sys/proc.h> 40#include <sys/fcntl.h> --- 28 unchanged lines hidden (view full) --- 69 kk[1] = key[0] << 7 | (key[1] >> 1 & 0xfe); 70 kk[2] = key[1] << 6 | (key[2] >> 2 & 0xfe); 71 kk[3] = key[2] << 5 | (key[3] >> 3 & 0xfe); 72 kk[4] = key[3] << 4 | (key[4] >> 4 & 0xfe); 73 kk[5] = key[4] << 3 | (key[5] >> 5 & 0xfe); 74 kk[6] = key[5] << 2 | (key[6] >> 6 & 0xfe); 75 kk[7] = key[6] << 1; 76 ksp = malloc(sizeof(des_key_schedule), M_SMBTEMP, M_WAITOK); |
77 des_set_key((C_Block*)kk, *ksp); 78 des_ecb_encrypt((C_Block*)data, (C_Block*)dest, *ksp, 1); | 77 des_set_key((des_cblock *)kk, *ksp); 78 des_ecb_encrypt((des_cblock *)data, (des_cblock *)dest, *ksp, 1); |
79 free(ksp, M_SMBTEMP); 80} 81#endif 82 83 84int 85smb_encrypt(const u_char *apwd, u_char *C8, u_char *RN) 86{ --- 60 unchanged lines hidden --- | 79 free(ksp, M_SMBTEMP); 80} 81#endif 82 83 84int 85smb_encrypt(const u_char *apwd, u_char *C8, u_char *RN) 86{ --- 60 unchanged lines hidden --- |