Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions
preenc.h File Reference
#include "seccomon.h"
#include "prio.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  PEFortezzaHeaderStr
struct  PEFortezzaGeneratedHeaderStr
struct  PEFixedKeyHeaderStr
struct  PERSAKeyHeaderStr
struct  PEHeaderStr
union  PEHeaderStr.u

Defines

#define PE_MIME_TYPE   "application/pre-encrypted"
#define PEFIXED_Label(header)   (header->data)
#define PEFIXED_KeyID(header)   (&header->data[GetInt2(header->labelLen)])
#define PEFIXED_IV(header)
#define PEFIXED_Key(header)
#define PERSA_Issuer(header)   (header->data)
#define PERSA_Serial(header)   (&header->data[GetInt2(header->issuerLen)])
#define PERSA_IV(header)
#define PERSA_Key(header)
#define PE_CRYPT_INTRO_LEN   8
#define PE_INTRO_LEN   4
#define PE_BASE_HEADER_LEN   8
#define PRE_BLOCK_SIZE   8
#define GetInt2(c)   ((c[0] << 8) | c[1])
#define GetInt4(c)
#define PutInt2(c, i)   ((c[1] = (i) & 0xff), (c[0] = ((i) >> 8) & 0xff))
#define PutInt4(c, i)
#define PRE_MAGIC   0xc0de
#define PRE_VERSION   0x1010
#define PRE_FORTEZZA_FILE   0x00ff
#define PRE_FORTEZZA_STREAM   0x00f5
#define PRE_FORTEZZA_GEN_STREAM   0x00f6
#define PRE_FIXED_FILE   0x000f
#define PRE_RSA_FILE   0x001f
#define PRE_FIXED_STREAM   0x0005

Typedefs

typedef struct PEHeaderStr
typedef struct PEFortezzaHeaderStr
typedef struct PEFortezzaGeneratedHeaderStr
typedef struct PEFixedKeyHeaderStr
typedef struct PERSAKeyHeaderStr

Functions

PEHeader * SSL_PreencryptedStreamToFile (PRFileDesc *fd, PEHeader *, int *headerSize)
PEHeader * SSL_PreencryptedFileToStream (PRFileDesc *fd, PEHeader *, int *headerSize)

Class Documentation

struct PEFortezzaHeaderStr

Definition at line 60 of file preenc.h.

Class Members
unsigned char hash
unsigned char iv
unsigned char key
unsigned char serial
struct PEFortezzaGeneratedHeaderStr

Definition at line 67 of file preenc.h.

Class Members
unsigned char hash
unsigned char iv
unsigned char key
unsigned char Ra
unsigned char Y
struct PEFixedKeyHeaderStr

Definition at line 75 of file preenc.h.

Class Members
unsigned char data
unsigned char ivLen
unsigned char keyIDLen
unsigned char keyLen
unsigned char labelLen
unsigned char pkcs11Mech
struct PERSAKeyHeaderStr

Definition at line 84 of file preenc.h.

Class Members
unsigned char data
unsigned char issuerLen
unsigned char ivLen
unsigned char keyLen
unsigned char pkcs11Mech
unsigned char serialLen
struct PEHeaderStr

Definition at line 105 of file preenc.h.

Class Members
unsigned char len
unsigned char magic
unsigned char type
union PEHeaderStr u
union PEHeaderStr u
unsigned char version
union PEHeaderStr.u

Definition at line 110 of file preenc.h.

Class Members
PEFixedKeyHeader fixed
PEFortezzaHeader fortezza
PEFortezzaGeneratedHeader g_fortezza
PERSAKeyHeader rsa

Define Documentation

#define GetInt2 (   c)    ((c[0] << 8) | c[1])

Definition at line 125 of file preenc.h.

#define GetInt4 (   c)
Value:
(((unsigned long)c[0] << 24)|((unsigned long)c[1] << 16)\
                     |((unsigned long)c[2] << 8)| ((unsigned long)c[3]))

Definition at line 126 of file preenc.h.

Definition at line 120 of file preenc.h.

Definition at line 118 of file preenc.h.

Definition at line 119 of file preenc.h.

#define PE_MIME_TYPE   "application/pre-encrypted"

Definition at line 53 of file preenc.h.

Value:
(&header->data[GetInt2(header->labelLen)\
                                          +GetInt2(header->keyIDLen)])

Definition at line 95 of file preenc.h.

Value:
(&header->data[GetInt2(header->labelLen)\
                     +GetInt2(header->keyIDLen)+GetInt2(header->keyLen)])

Definition at line 97 of file preenc.h.

#define PEFIXED_KeyID (   header)    (&header->data[GetInt2(header->labelLen)])

Definition at line 94 of file preenc.h.

Definition at line 93 of file preenc.h.

Definition at line 99 of file preenc.h.

Value:
(&header->data[GetInt2(header->issuerLen)\
                                          +GetInt2(header->serialLen)])

Definition at line 101 of file preenc.h.

Value:
(&header->data[GetInt2(header->issuerLen)\
                     +GetInt2(header->serialLen)+GetInt2(header->keyLen)])

Definition at line 103 of file preenc.h.

#define PERSA_Serial (   header)    (&header->data[GetInt2(header->issuerLen)])

Definition at line 100 of file preenc.h.

Definition at line 122 of file preenc.h.

#define PRE_FIXED_FILE   0x000f

Definition at line 137 of file preenc.h.

#define PRE_FIXED_STREAM   0x0005

Definition at line 139 of file preenc.h.

#define PRE_FORTEZZA_FILE   0x00ff

Definition at line 134 of file preenc.h.

Definition at line 136 of file preenc.h.

Definition at line 135 of file preenc.h.

#define PRE_MAGIC   0xc0de

Definition at line 132 of file preenc.h.

#define PRE_RSA_FILE   0x001f

Definition at line 138 of file preenc.h.

#define PRE_VERSION   0x1010

Definition at line 133 of file preenc.h.

#define PutInt2 (   c,
  i 
)    ((c[1] = (i) & 0xff), (c[0] = ((i) >> 8) & 0xff))

Definition at line 128 of file preenc.h.

#define PutInt4 (   c,
  i 
)
Value:
((c[0]=((i) >> 24) & 0xff),(c[1]=((i) >> 16) & 0xff),\
                     (c[2] = ((i) >> 8) & 0xff), (c[3] = (i) & 0xff))

Definition at line 129 of file preenc.h.


Typedef Documentation

typedef struct PEFixedKeyHeaderStr

Definition at line 57 of file preenc.h.

Definition at line 56 of file preenc.h.

typedef struct PEFortezzaHeaderStr

Definition at line 55 of file preenc.h.

typedef struct PEHeaderStr

Definition at line 51 of file preenc.h.

typedef struct PERSAKeyHeaderStr

Definition at line 58 of file preenc.h.


Function Documentation

PEHeader* SSL_PreencryptedFileToStream ( PRFileDesc fd,
PEHeader *  ,
int headerSize 
)

Definition at line 60 of file prelib.c.

PEHeader* SSL_PreencryptedStreamToFile ( PRFileDesc fd,
PEHeader *  ,
int headerSize 
)

Definition at line 53 of file prelib.c.