1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/openssl/ossl_pkey_dsa.c: remove redundant colon from error

message.
* ext/openssl/ossl_ssl.c: ditto.
* ext/openssl/ossl_pkey_rsa: ditto.
[Bug #5604] [ruby-core:40896]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
emboss 2011-11-23 23:15:09 +00:00
parent 1eb0f880d2
commit 29b0d9d932
4 changed files with 21 additions and 13 deletions

View file

@ -1,3 +1,11 @@
Thu Nov 24 08:05:02 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
* ext/openssl/ossl_pkey_dsa.c: remove redundant colon from error
message.
* ext/openssl/ossl_ssl.c: ditto.
* ext/openssl/ossl_pkey_rsa: ditto.
[Bug #5604] [ruby-core:40896]
Wed Nov 23 20:03:43 2011 NARUSE, Yui <naruse@ruby-lang.org> Wed Nov 23 20:03:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
* io.c (ioctl_narg_len): don't use _IOC_SIZE macro on Linux. * io.c (ioctl_narg_len): don't use _IOC_SIZE macro on Linux.

View file

@ -244,7 +244,7 @@ ossl_dsa_initialize(int argc, VALUE *argv, VALUE self)
BIO_free(in); BIO_free(in);
if (!dsa) { if (!dsa) {
ERR_clear_error(); ERR_clear_error();
ossl_raise(eDSAError, "Neither PUB key nor PRIV key:"); ossl_raise(eDSAError, "Neither PUB key nor PRIV key");
} }
} }
if (!EVP_PKEY_assign_DSA(pkey, dsa)) { if (!EVP_PKEY_assign_DSA(pkey, dsa)) {

View file

@ -243,7 +243,7 @@ ossl_rsa_initialize(int argc, VALUE *argv, VALUE self)
} }
BIO_free(in); BIO_free(in);
if (!rsa) { if (!rsa) {
ossl_raise(eRSAError, "Neither PUB key nor PRIV key:"); ossl_raise(eRSAError, "Neither PUB key nor PRIV key");
} }
} }
if (!EVP_PKEY_assign_RSA(pkey, rsa)) { if (!EVP_PKEY_assign_RSA(pkey, rsa)) {

View file

@ -148,7 +148,7 @@ ossl_sslctx_s_alloc(VALUE klass)
ctx = SSL_CTX_new(SSLv23_method()); ctx = SSL_CTX_new(SSLv23_method());
if (!ctx) { if (!ctx) {
ossl_raise(eSSLError, "SSL_CTX_new:"); ossl_raise(eSSLError, "SSL_CTX_new");
} }
SSL_CTX_set_mode(ctx, mode); SSL_CTX_set_mode(ctx, mode);
SSL_CTX_set_options(ctx, SSL_OP_ALL); SSL_CTX_set_options(ctx, SSL_OP_ALL);
@ -185,7 +185,7 @@ ossl_sslctx_set_ssl_version(VALUE self, VALUE ssl_method)
} }
Data_Get_Struct(self, SSL_CTX, ctx); Data_Get_Struct(self, SSL_CTX, ctx);
if (SSL_CTX_set_ssl_version(ctx, method) != 1) { if (SSL_CTX_set_ssl_version(ctx, method) != 1) {
ossl_raise(eSSLError, "SSL_CTX_set_ssl_version:"); ossl_raise(eSSLError, "SSL_CTX_set_ssl_version");
} }
return ssl_method; return ssl_method;
@ -590,14 +590,14 @@ ossl_sslctx_setup(VALUE self)
if (cert && key) { if (cert && key) {
if (!SSL_CTX_use_certificate(ctx, cert)) { if (!SSL_CTX_use_certificate(ctx, cert)) {
/* Adds a ref => Safe to FREE */ /* Adds a ref => Safe to FREE */
ossl_raise(eSSLError, "SSL_CTX_use_certificate:"); ossl_raise(eSSLError, "SSL_CTX_use_certificate");
} }
if (!SSL_CTX_use_PrivateKey(ctx, key)) { if (!SSL_CTX_use_PrivateKey(ctx, key)) {
/* Adds a ref => Safe to FREE */ /* Adds a ref => Safe to FREE */
ossl_raise(eSSLError, "SSL_CTX_use_PrivateKey:"); ossl_raise(eSSLError, "SSL_CTX_use_PrivateKey");
} }
if (!SSL_CTX_check_private_key(ctx)) { if (!SSL_CTX_check_private_key(ctx)) {
ossl_raise(eSSLError, "SSL_CTX_check_private_key:"); ossl_raise(eSSLError, "SSL_CTX_check_private_key");
} }
} }
@ -651,7 +651,7 @@ ossl_sslctx_setup(VALUE self)
StringValue(val); StringValue(val);
if (!SSL_CTX_set_session_id_context(ctx, (unsigned char *)RSTRING_PTR(val), if (!SSL_CTX_set_session_id_context(ctx, (unsigned char *)RSTRING_PTR(val),
RSTRING_LENINT(val))){ RSTRING_LENINT(val))){
ossl_raise(eSSLError, "SSL_CTX_set_session_id_context:"); ossl_raise(eSSLError, "SSL_CTX_set_session_id_context");
} }
} }
@ -771,7 +771,7 @@ ossl_sslctx_set_ciphers(VALUE self, VALUE v)
return Qnil; return Qnil;
} }
if (!SSL_CTX_set_cipher_list(ctx, RSTRING_PTR(str))) { if (!SSL_CTX_set_cipher_list(ctx, RSTRING_PTR(str))) {
ossl_raise(eSSLError, "SSL_CTX_set_cipher_list:"); ossl_raise(eSSLError, "SSL_CTX_set_cipher_list");
} }
return v; return v;
@ -1058,14 +1058,14 @@ ossl_ssl_setup(VALUE self)
ssl = SSL_new(ctx); ssl = SSL_new(ctx);
if (!ssl) { if (!ssl) {
ossl_raise(eSSLError, "SSL_new:"); ossl_raise(eSSLError, "SSL_new");
} }
DATA_PTR(self) = ssl; DATA_PTR(self) = ssl;
#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME #ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
if (!NIL_P(hostname)) { if (!NIL_P(hostname)) {
if (SSL_set_tlsext_host_name(ssl, StringValuePtr(hostname)) != 1) if (SSL_set_tlsext_host_name(ssl, StringValuePtr(hostname)) != 1)
ossl_raise(eSSLError, "SSL_set_tlsext_host_name:"); ossl_raise(eSSLError, "SSL_set_tlsext_host_name");
} }
#endif #endif
io = ossl_ssl_get_io(self); io = ossl_ssl_get_io(self);
@ -1273,7 +1273,7 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
if(ERR_peek_error() == 0 && nread == 0) rb_eof_error(); if(ERR_peek_error() == 0 && nread == 0) rb_eof_error();
rb_sys_fail(0); rb_sys_fail(0);
default: default:
ossl_raise(eSSLError, "SSL_read:"); ossl_raise(eSSLError, "SSL_read");
} }
} }
} }
@ -1350,7 +1350,7 @@ ossl_ssl_write_internal(VALUE self, VALUE str, int nonblock)
case SSL_ERROR_SYSCALL: case SSL_ERROR_SYSCALL:
if (errno) rb_sys_fail(0); if (errno) rb_sys_fail(0);
default: default:
ossl_raise(eSSLError, "SSL_write:"); ossl_raise(eSSLError, "SSL_write");
} }
} }
} }