OLD | NEW |
1 /* ssl/s2_enc.c */ | 1 /* ssl/s2_enc.c */ |
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * This package is an SSL implementation written | 5 * This package is an SSL implementation written |
6 * by Eric Young (eay@cryptsoft.com). | 6 * by Eric Young (eay@cryptsoft.com). |
7 * The implementation was written so as to conform with Netscapes SSL. | 7 * The implementation was written so as to conform with Netscapes SSL. |
8 * | 8 * |
9 * This library is free for commercial and non-commercial use as long as | 9 * This library is free for commercial and non-commercial use as long as |
10 * the following conditions are aheared to. The following conditions | 10 * the following conditions are aheared to. The following conditions |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #include <stdio.h> | 61 #include <stdio.h> |
62 | 62 |
63 int ssl2_enc_init(SSL *s, int client) | 63 int ssl2_enc_init(SSL *s, int client) |
64 { | 64 { |
65 /* Max number of bytes needed */ | 65 /* Max number of bytes needed */ |
66 EVP_CIPHER_CTX *rs,*ws; | 66 EVP_CIPHER_CTX *rs,*ws; |
67 const EVP_CIPHER *c; | 67 const EVP_CIPHER *c; |
68 const EVP_MD *md; | 68 const EVP_MD *md; |
69 int num; | 69 int num; |
70 | 70 |
71 » if (!ssl_cipher_get_evp(s->session,&c,&md,NULL,NULL,NULL)) | 71 » if (!ssl_cipher_get_evp(s->session,&c,&md,NULL,NULL)) |
72 { | 72 { |
73 ssl2_return_error(s,SSL2_PE_NO_CIPHER); | 73 ssl2_return_error(s,SSL2_PE_NO_CIPHER); |
74 SSLerr(SSL_F_SSL2_ENC_INIT,SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIO
NS); | 74 SSLerr(SSL_F_SSL2_ENC_INIT,SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIO
NS); |
75 return(0); | 75 return(0); |
76 } | 76 } |
77 ssl_replace_hash(&s->read_hash,md); | 77 ssl_replace_hash(&s->read_hash,md); |
78 ssl_replace_hash(&s->write_hash,md); | 78 ssl_replace_hash(&s->write_hash,md); |
79 | 79 |
80 if ((s->enc_read_ctx == NULL) && | 80 if ((s->enc_read_ctx == NULL) && |
81 ((s->enc_read_ctx=(EVP_CIPHER_CTX *) | 81 ((s->enc_read_ctx=(EVP_CIPHER_CTX *) |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 EVP_DigestFinal_ex(&c,md,NULL); | 184 EVP_DigestFinal_ex(&c,md,NULL); |
185 EVP_MD_CTX_cleanup(&c); | 185 EVP_MD_CTX_cleanup(&c); |
186 } | 186 } |
187 #else /* !OPENSSL_NO_SSL2 */ | 187 #else /* !OPENSSL_NO_SSL2 */ |
188 | 188 |
189 # if PEDANTIC | 189 # if PEDANTIC |
190 static void *dummy=&dummy; | 190 static void *dummy=&dummy; |
191 # endif | 191 # endif |
192 | 192 |
193 #endif | 193 #endif |
OLD | NEW |