diff options
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
-rw-r--r-- | src/lib/libssl/ssl_lib.c | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 2bd9a5af86..631229558f 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c | |||
@@ -125,7 +125,7 @@ | |||
125 | 125 | ||
126 | const char *SSL_version_str=OPENSSL_VERSION_TEXT; | 126 | const char *SSL_version_str=OPENSSL_VERSION_TEXT; |
127 | 127 | ||
128 | SSL3_ENC_METHOD ssl3_undef_enc_method={ | 128 | OPENSSL_GLOBAL SSL3_ENC_METHOD ssl3_undef_enc_method={ |
129 | /* evil casts, but these functions are only called if there's a library bug */ | 129 | /* evil casts, but these functions are only called if there's a library bug */ |
130 | (int (*)(SSL *,int))ssl_undefined_function, | 130 | (int (*)(SSL *,int))ssl_undefined_function, |
131 | (int (*)(SSL *, unsigned char *, int))ssl_undefined_function, | 131 | (int (*)(SSL *, unsigned char *, int))ssl_undefined_function, |
@@ -1130,21 +1130,8 @@ int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str) | |||
1130 | 1130 | ||
1131 | sk=ssl_create_cipher_list(ctx->method,&ctx->cipher_list, | 1131 | sk=ssl_create_cipher_list(ctx->method,&ctx->cipher_list, |
1132 | &ctx->cipher_list_by_id,str); | 1132 | &ctx->cipher_list_by_id,str); |
1133 | /* ssl_create_cipher_list may return an empty stack if it | 1133 | /* XXXX */ |
1134 | * was unable to find a cipher matching the given rule string | 1134 | return((sk == NULL)?0:1); |
1135 | * (for example if the rule string specifies a cipher which | ||
1136 | * has been disabled). This is not an error as far as | ||
1137 | * ssl_create_cipher_list is concerned, and hence | ||
1138 | * ctx->cipher_list and ctx->cipher_list_by_id has been | ||
1139 | * updated. */ | ||
1140 | if (sk == NULL) | ||
1141 | return 0; | ||
1142 | else if (sk_SSL_CIPHER_num(sk) == 0) | ||
1143 | { | ||
1144 | SSLerr(SSL_F_SSL_CTX_SET_CIPHER_LIST, SSL_R_NO_CIPHER_MATCH); | ||
1145 | return 0; | ||
1146 | } | ||
1147 | return 1; | ||
1148 | } | 1135 | } |
1149 | 1136 | ||
1150 | /** specify the ciphers to be used by the SSL */ | 1137 | /** specify the ciphers to be used by the SSL */ |
@@ -1154,15 +1141,8 @@ int SSL_set_cipher_list(SSL *s,const char *str) | |||
1154 | 1141 | ||
1155 | sk=ssl_create_cipher_list(s->ctx->method,&s->cipher_list, | 1142 | sk=ssl_create_cipher_list(s->ctx->method,&s->cipher_list, |
1156 | &s->cipher_list_by_id,str); | 1143 | &s->cipher_list_by_id,str); |
1157 | /* see comment in SSL_CTX_set_cipher_list */ | 1144 | /* XXXX */ |
1158 | if (sk == NULL) | 1145 | return((sk == NULL)?0:1); |
1159 | return 0; | ||
1160 | else if (sk_SSL_CIPHER_num(sk) == 0) | ||
1161 | { | ||
1162 | SSLerr(SSL_F_SSL_SET_CIPHER_LIST, SSL_R_NO_CIPHER_MATCH); | ||
1163 | return 0; | ||
1164 | } | ||
1165 | return 1; | ||
1166 | } | 1146 | } |
1167 | 1147 | ||
1168 | /* works well for SSLv2, not so good for SSLv3 */ | 1148 | /* works well for SSLv2, not so good for SSLv3 */ |
@@ -1201,8 +1181,7 @@ char *SSL_get_shared_ciphers(const SSL *s,char *buf,int len) | |||
1201 | return(buf); | 1181 | return(buf); |
1202 | } | 1182 | } |
1203 | 1183 | ||
1204 | int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p, | 1184 | int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p) |
1205 | int (*put_cb)(const SSL_CIPHER *, unsigned char *)) | ||
1206 | { | 1185 | { |
1207 | int i,j=0; | 1186 | int i,j=0; |
1208 | SSL_CIPHER *c; | 1187 | SSL_CIPHER *c; |
@@ -1221,8 +1200,7 @@ int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p, | |||
1221 | if ((c->algorithms & SSL_KRB5) && nokrb5) | 1200 | if ((c->algorithms & SSL_KRB5) && nokrb5) |
1222 | continue; | 1201 | continue; |
1223 | #endif /* OPENSSL_NO_KRB5 */ | 1202 | #endif /* OPENSSL_NO_KRB5 */ |
1224 | 1203 | j=ssl_put_cipher_by_char(s,c,p); | |
1225 | j = put_cb ? put_cb(c,p) : ssl_put_cipher_by_char(s,c,p); | ||
1226 | p+=j; | 1204 | p+=j; |
1227 | } | 1205 | } |
1228 | return(p-q); | 1206 | return(p-q); |
@@ -1716,7 +1694,7 @@ void ssl_update_cache(SSL *s,int mode) | |||
1716 | ?s->ctx->stats.sess_connect_good | 1694 | ?s->ctx->stats.sess_connect_good |
1717 | :s->ctx->stats.sess_accept_good) & 0xff) == 0xff) | 1695 | :s->ctx->stats.sess_accept_good) & 0xff) == 0xff) |
1718 | { | 1696 | { |
1719 | SSL_CTX_flush_sessions(s->ctx,(unsigned long)time(NULL)); | 1697 | SSL_CTX_flush_sessions(s->ctx,time(NULL)); |
1720 | } | 1698 | } |
1721 | } | 1699 | } |
1722 | } | 1700 | } |