88 lines
3.0 KiB
C
88 lines
3.0 KiB
C
/****************************************************************************
|
|
|
|
|
| (C) Copyright 2001 Novell, Inc.
|
|
| All Rights Reserved.
|
|
|
|
|
| This program is free software; you can redistribute it and/or
|
|
| modify it under the terms of version 2 of the GNU General Public
|
|
| License as published by the Free Software Foundation.
|
|
|
|
|
| This program is distributed in the hope that it will be useful,
|
|
| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| GNU General Public License for more details.
|
|
|
|
|
| You should have received a copy of the GNU General Public License
|
|
| along with this program; if not, contact Novell, Inc.
|
|
|
|
|
| To contact Novell about this file by physical or electronic mail,
|
|
| you may find current contact information at www.novell.com
|
|
|
|
|
|***************************************************************************
|
|
|
|
|
| Novell Storage Services (NSS) module
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
|
|
|
| $Author: blarsen $
|
|
| $Date: 2005-05-24 00:31:55 +0530 (Tue, 24 May 2005) $
|
|
|
|
|
| $RCSfile$
|
|
| $Revision: 1001 $
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
| This module is used to:
|
|
| Define includes associated with Encrypted Volume Support
|
|
+-------------------------------------------------------------------------*/
|
|
#ifndef _EVS_H_
|
|
#define _EVS_H_
|
|
|
|
#if zNETWARE
|
|
#ifndef _NWCCS_H_
|
|
#include "nwccs.h"
|
|
#endif
|
|
#endif
|
|
|
|
#define ENCRYPTED_VOLUME_PASSWORD_LENGTH (16)
|
|
#define ENCRYPTED_VOLUME_KEY_LENGTH (16)
|
|
|
|
#define MIN_BUFS_PER_ENCRYPTED_VOLUME (1)
|
|
#define MAX_BUFS_PER_ENCRYPTED_VOLUME (1000)
|
|
|
|
#if zNETWARE || (zLINUX && defined(__KERNEL__))
|
|
extern NINT Pages_Per_Encrypted_Volume;
|
|
|
|
/* This is no more than a structure to define a linked list of buffers used to
|
|
* encrypt/decryt cache buffers.
|
|
*/
|
|
typedef struct EncryptedBufPage_s
|
|
{
|
|
STKlink_t link;
|
|
} EncryptedBufPage_s;
|
|
#endif
|
|
|
|
/* This structure contains info needed to support encrypted volumes. A pointer to this stucture
|
|
is provided in Volume_s->v_crypt and if non-null, points to this structure
|
|
*/
|
|
typedef struct PersistentVolumeCrypt_s {
|
|
BYTE version; /* 1 */
|
|
BYTE flags; /* 1 */
|
|
BYTE reserved1[2]; /* 2 pad to alignment */
|
|
BYTE salt[16]; /* 16 */
|
|
BYTE wrappedKey[24]; /* 24 */
|
|
LONG wrappedKeyLen; /* 4 */
|
|
BYTE reserved2[128-1-1-2-16-24-4-20-4]; /* fill out 128 bytes, all through reserved2 is included in the mac */
|
|
BYTE mac[20]; /* 20 */
|
|
LONG macLen; /* 4 */
|
|
} NSS_MEDIA_STRUCTURE(PersistentVolumeCrypt_s,macLen) PersistentVolumeCrypt_s;
|
|
|
|
typedef struct VolumeKey_s {
|
|
BYTE key[ENCRYPTED_VOLUME_KEY_LENGTH]; /* 128-bit AES key */
|
|
BYTE iv[16]; /* 128-bit IV for AES */
|
|
NINT numCryptBuffers; /* number of buffers allocated for crypt work */
|
|
PersistentVolumeCrypt_s p; /* persistent data, created at volume init time */
|
|
}VolumeKey_s;
|
|
|
|
|
|
#endif /* _EVS_H_ */
|