]>
Commit | Line | Data |
---|---|---|
bac41a7b A |
1 | /* |
2 | * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved. | |
3 | * | |
4 | * The contents of this file constitute Original Code as defined in and are | |
5 | * subject to the Apple Public Source License Version 1.2 (the 'License'). | |
6 | * You may not use this file except in compliance with the License. Please obtain | |
7 | * a copy of the License at http://www.apple.com/publicsource and read it before | |
8 | * using this file. | |
9 | * | |
10 | * This Original Code and all software distributed under the License are | |
11 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS | |
12 | * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT | |
13 | * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | |
14 | * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the | |
15 | * specific language governing rights and limitations under the License. | |
16 | */ | |
17 | ||
18 | ||
5a719ac8 | 19 | #include "sslContext.h" |
bac41a7b A |
20 | |
21 | #include <string.h> | |
22 | ||
5a719ac8 | 23 | static OSStatus NullInit( |
bac41a7b A |
24 | uint8 *key, |
25 | uint8* iv, | |
26 | CipherContext *cipherCtx, | |
27 | SSLContext *ctx); | |
5a719ac8 | 28 | static OSStatus NullCrypt( |
bac41a7b A |
29 | SSLBuffer src, |
30 | SSLBuffer dest, | |
31 | CipherContext *cipherCtx, | |
32 | SSLContext *ctx); | |
5a719ac8 | 33 | static OSStatus NullFinish( |
bac41a7b A |
34 | CipherContext *cipherCtx, |
35 | SSLContext *ctx); | |
36 | ||
5a719ac8 A |
37 | extern "C" { |
38 | extern const SSLSymmetricCipher SSLCipherNull; | |
39 | } | |
bac41a7b A |
40 | const SSLSymmetricCipher SSLCipherNull = { |
41 | 0, /* Key size in bytes (ignoring parity) */ | |
42 | 0, /* Secret key size */ | |
43 | 0, /* IV size */ | |
44 | 0, /* Block size */ | |
bac41a7b A |
45 | CSSM_ALGID_NONE, |
46 | CSSM_ALGID_NONE, | |
47 | CSSM_ALGMODE_NONE, | |
48 | CSSM_PADDING_NONE, | |
bac41a7b A |
49 | NullInit, |
50 | NullCrypt, | |
51 | NullCrypt, | |
52 | NullFinish | |
53 | }; | |
54 | ||
5a719ac8 | 55 | static OSStatus NullInit( |
bac41a7b A |
56 | uint8 *key, |
57 | uint8* iv, | |
58 | CipherContext *cipherCtx, | |
59 | SSLContext *ctx) | |
60 | { | |
5a719ac8 | 61 | return noErr; |
bac41a7b A |
62 | } |
63 | ||
5a719ac8 | 64 | static OSStatus NullCrypt( |
bac41a7b A |
65 | SSLBuffer src, |
66 | SSLBuffer dest, | |
67 | CipherContext *cipherCtx, | |
68 | SSLContext *ctx) | |
69 | { | |
70 | if (src.data != dest.data) | |
71 | memcpy(dest.data, src.data, src.length); | |
5a719ac8 | 72 | return noErr; |
bac41a7b A |
73 | } |
74 | ||
5a719ac8 | 75 | static OSStatus NullFinish( |
bac41a7b A |
76 | CipherContext *cipherCtx, |
77 | SSLContext *ctx) | |
78 | { | |
5a719ac8 | 79 | return noErr; |
bac41a7b | 80 | } |