Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: net/third_party/nss/ssl/preenc.h

Issue 1882433002: Removing NSS files and USE_OPENSSL flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/third_party/nss/ssl/os2_err.c ('k') | net/third_party/nss/ssl/prelib.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
2
3 /*
4 * Fortezza support is removed.
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9
10 /* Fortezza support is removed.
11 * This file remains so that old programs will continue to compile,
12 * But this functionality is no longer supported or implemented.
13 */
14
15 #include "seccomon.h"
16 #include "prio.h"
17
18 typedef struct PEHeaderStr PEHeader;
19
20 #define PE_MIME_TYPE "application/pre-encrypted"
21
22 typedef struct PEFortezzaHeaderStr PEFortezzaHeader;
23 typedef struct PEFortezzaGeneratedHeaderStr PEFortezzaGeneratedHeader;
24 typedef struct PEFixedKeyHeaderStr PEFixedKeyHeader;
25 typedef struct PERSAKeyHeaderStr PERSAKeyHeader;
26
27 struct PEFortezzaHeaderStr {
28 unsigned char key[12];
29 unsigned char iv[24];
30 unsigned char hash[20];
31 unsigned char serial[8];
32 };
33
34 struct PEFortezzaGeneratedHeaderStr {
35 unsigned char key[12];
36 unsigned char iv[24];
37 unsigned char hash[20];
38 unsigned char Ra[128];
39 unsigned char Y[128];
40 };
41
42 struct PEFixedKeyHeaderStr {
43 unsigned char pkcs11Mech[4];
44 unsigned char labelLen[2];
45 unsigned char keyIDLen[2];
46 unsigned char ivLen[2];
47 unsigned char keyLen[2];
48 unsigned char data[1];
49 };
50
51 struct PERSAKeyHeaderStr {
52 unsigned char pkcs11Mech[4];
53 unsigned char issuerLen[2];
54 unsigned char serialLen[2];
55 unsigned char ivLen[2];
56 unsigned char keyLen[2];
57 unsigned char data[1];
58 };
59
60 #define PEFIXED_Label(header) (header->data)
61 #define PEFIXED_KeyID(header) (&header->data[GetInt2(header->labelLen)])
62 #define PEFIXED_IV(header) (&header->data[GetInt2(header->labelLen) + \
63 GetInt2(header->keyIDLen)])
64 #define PEFIXED_Key(header) (&header->data[GetInt2(header->labelLen) + \
65 GetInt2(header->keyIDLen) + \
66 GetInt2(header->keyLen)])
67 #define PERSA_Issuer(header) (header->data)
68 #define PERSA_Serial(header) (&header->data[GetInt2(header->issuerLen)])
69 #define PERSA_IV(header) (&header->data[GetInt2(header->issuerLen) + \
70 GetInt2(header->serialLen)])
71 #define PERSA_Key(header) (&header->data[GetInt2(header->issuerLen) + \
72 GetInt2(header->serialLen) + \
73 GetInt2(header->keyLen)])
74 struct PEHeaderStr {
75 unsigned char magic[2];
76 unsigned char len[2];
77 unsigned char type[2];
78 unsigned char version[2];
79 union {
80 PEFortezzaHeader fortezza;
81 PEFortezzaGeneratedHeader g_fortezza;
82 PEFixedKeyHeader fixed;
83 PERSAKeyHeader rsa;
84 } u;
85 };
86
87 #define PE_CRYPT_INTRO_LEN 8
88 #define PE_INTRO_LEN 4
89 #define PE_BASE_HEADER_LEN 8
90
91 #define PRE_BLOCK_SIZE 8
92
93 #define GetInt2(c) ((c[0] << 8) | c[1])
94 #define GetInt4(c) (((unsigned long)c[0] << 24) | ((unsigned long)c[1] << 16) | \
95 ((unsigned long)c[2] << 8) | ((unsigned long)c[3]))
96 #define PutInt2(c, i) ((c[1] = (i)&0xff), (c[0] = ((i) >> 8) & 0xff))
97 #define PutInt4(c, i) ((c[0] = ((i) >> 24) & 0xff), (c[1] = ((i) >> 16) & 0xff), \
98 (c[2] = ((i) >> 8) & 0xff), (c[3] = (i)&0xff))
99
100 #define PRE_MAGIC 0xc0de
101 #define PRE_VERSION 0x1010
102 #define PRE_FORTEZZA_FILE 0x00ff
103 #define PRE_FORTEZZA_STREAM 0x00f5
104 #define PRE_FORTEZZA_GEN_STREAM 0x00f6
105 #define PRE_FIXED_FILE 0x000f
106 #define PRE_RSA_FILE 0x001f
107 #define PRE_FIXED_STREAM 0x0005
108
109 PEHeader *SSL_PreencryptedStreamToFile(PRFileDesc *fd, PEHeader *,
110 int *headerSize);
111
112 PEHeader *SSL_PreencryptedFileToStream(PRFileDesc *fd, PEHeader *,
113 int *headerSize);
OLDNEW
« no previous file with comments | « net/third_party/nss/ssl/os2_err.c ('k') | net/third_party/nss/ssl/prelib.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698