mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/openssl/ossl_ssl.c (ssl_npn_encode_protocol_i): fix byte order
issue on big-endian architecture [ruby-core:50292] [Bug #7463] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
40a442541c
commit
36c40166ac
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Nov 29 22:39:35 2012 Naohisa Goto <ngotogenome@gmail.com>
|
||||||
|
|
||||||
|
* ext/openssl/ossl_ssl.c (ssl_npn_encode_protocol_i): fix byte order
|
||||||
|
issue on big-endian architecture [ruby-core:50292] [Bug #7463]
|
||||||
|
|
||||||
Thu Nov 29 22:23:31 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
|
Thu Nov 29 22:23:31 2012 Hiroshi Nakamura <nahi@ruby-lang.org>
|
||||||
|
|
||||||
* test/openssl/test_cipher.rb (test_ctr_if_exists): add CTR mode test
|
* test/openssl/test_cipher.rb (test_ctr_if_exists): add CTR mode test
|
||||||
|
|
|
@ -569,10 +569,12 @@ static VALUE
|
||||||
ssl_npn_encode_protocol_i(VALUE cur, VALUE encoded)
|
ssl_npn_encode_protocol_i(VALUE cur, VALUE encoded)
|
||||||
{
|
{
|
||||||
int len = RSTRING_LENINT(cur);
|
int len = RSTRING_LENINT(cur);
|
||||||
|
char len_byte;
|
||||||
if (len < 1 || len > 255)
|
if (len < 1 || len > 255)
|
||||||
ossl_raise(eSSLError, "Advertised protocol must have length 1..255");
|
ossl_raise(eSSLError, "Advertised protocol must have length 1..255");
|
||||||
/* Encode the length byte */
|
/* Encode the length byte */
|
||||||
rb_str_buf_cat(encoded, (const char *) &len, 1);
|
len_byte = len;
|
||||||
|
rb_str_buf_cat(encoded, &len_byte, 1);
|
||||||
rb_str_buf_cat(encoded, RSTRING_PTR(cur), len);
|
rb_str_buf_cat(encoded, RSTRING_PTR(cur), len);
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue