зеркало из https://github.com/github/ruby.git
* ext/openssl/ossl_hmac.c (ossl_hmac_hexdigest, ossl_hmac_s_hexdigest),
ext/openssl/ossl_pkey_ec.c (ossl_ec_group_set_seed), ext/openssl/ossl_ssl_session.c (ossl_ssl_session_to_der), ext/openssl/ossl_pkcs7.c (numberof): suppress warnings. [ruby-core:31932] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
a67600d12b
Коммит
7b77b436f0
|
@ -1,3 +1,11 @@
|
||||||
|
Sun Sep 26 22:21:07 2010 wanabe <s.wanabe@gmail.com>
|
||||||
|
|
||||||
|
* ext/openssl/ossl_hmac.c (ossl_hmac_hexdigest, ossl_hmac_s_hexdigest),
|
||||||
|
ext/openssl/ossl_pkey_ec.c (ossl_ec_group_set_seed),
|
||||||
|
ext/openssl/ossl_ssl_session.c (ossl_ssl_session_to_der),
|
||||||
|
ext/openssl/ossl_pkcs7.c (numberof): suppress warnings.
|
||||||
|
[ruby-core:31932]
|
||||||
|
|
||||||
Sun Sep 26 10:25:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Sep 26 10:25:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* tool/config.{guess,sub}: updated to automake-1.11.1.
|
* tool/config.{guess,sub}: updated to automake-1.11.1.
|
||||||
|
|
|
@ -159,7 +159,7 @@ ossl_hmac_hexdigest(VALUE self)
|
||||||
|
|
||||||
GetHMAC(self, ctx);
|
GetHMAC(self, ctx);
|
||||||
hmac_final(ctx, &buf, &buf_len);
|
hmac_final(ctx, &buf, &buf_len);
|
||||||
if (string2hex(buf, buf_len, &hexbuf, NULL) != 2 * buf_len) {
|
if (string2hex(buf, buf_len, &hexbuf, NULL) != 2 * (int)buf_len) {
|
||||||
OPENSSL_free(buf);
|
OPENSSL_free(buf);
|
||||||
ossl_raise(eHMACError, "Memory alloc error");
|
ossl_raise(eHMACError, "Memory alloc error");
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ ossl_hmac_s_hexdigest(VALUE klass, VALUE digest, VALUE key, VALUE data)
|
||||||
|
|
||||||
buf = HMAC(GetDigestPtr(digest), RSTRING_PTR(key), RSTRING_LEN(key),
|
buf = HMAC(GetDigestPtr(digest), RSTRING_PTR(key), RSTRING_LEN(key),
|
||||||
(unsigned char *)RSTRING_PTR(data), RSTRING_LEN(data), NULL, &buf_len);
|
(unsigned char *)RSTRING_PTR(data), RSTRING_LEN(data), NULL, &buf_len);
|
||||||
if (string2hex(buf, buf_len, &hexbuf, NULL) != 2 * buf_len) {
|
if (string2hex(buf, buf_len, &hexbuf, NULL) != 2 * (int)buf_len) {
|
||||||
ossl_raise(eHMACError, "Cannot convert buf to hexbuf");
|
ossl_raise(eHMACError, "Cannot convert buf to hexbuf");
|
||||||
}
|
}
|
||||||
hexdigest = ossl_buf2str(hexbuf, 2 * buf_len);
|
hexdigest = ossl_buf2str(hexbuf, 2 * buf_len);
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
GetPKCS7ri(obj, p7ri); \
|
GetPKCS7ri(obj, p7ri); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define numberof(ary) (sizeof(ary)/sizeof(ary[0]))
|
#define numberof(ary) (int)(sizeof(ary)/sizeof(ary[0]))
|
||||||
|
|
||||||
#define ossl_pkcs7_set_data(o,v) rb_iv_set((o), "@data", (v))
|
#define ossl_pkcs7_set_data(o,v) rb_iv_set((o), "@data", (v))
|
||||||
#define ossl_pkcs7_get_data(o) rb_iv_get((o), "@data")
|
#define ossl_pkcs7_get_data(o) rb_iv_get((o), "@data")
|
||||||
|
|
|
@ -1107,7 +1107,7 @@ static VALUE ossl_ec_group_set_seed(VALUE self, VALUE seed)
|
||||||
Require_EC_GROUP(self, group);
|
Require_EC_GROUP(self, group);
|
||||||
StringValue(seed);
|
StringValue(seed);
|
||||||
|
|
||||||
if (EC_GROUP_set_seed(group, (unsigned char *)RSTRING_PTR(seed), RSTRING_LEN(seed)) != RSTRING_LEN(seed))
|
if (EC_GROUP_set_seed(group, (unsigned char *)RSTRING_PTR(seed), RSTRING_LEN(seed)) != (size_t)RSTRING_LEN(seed))
|
||||||
ossl_raise(eEC_GROUP, "EC_GROUP_set_seed");
|
ossl_raise(eEC_GROUP, "EC_GROUP_set_seed");
|
||||||
|
|
||||||
return seed;
|
return seed;
|
||||||
|
|
|
@ -205,7 +205,7 @@ static VALUE ossl_ssl_session_to_der(VALUE self)
|
||||||
|
|
||||||
if (len <= 0)
|
if (len <= 0)
|
||||||
ossl_raise(eSSLSession, "i2d_SSL_SESSION");
|
ossl_raise(eSSLSession, "i2d_SSL_SESSION");
|
||||||
else if (len >= sizeof(buf))
|
else if (len >= (int)sizeof(buf))
|
||||||
ossl_raise(eSSLSession, "i2d_SSL_SESSION too large");
|
ossl_raise(eSSLSession, "i2d_SSL_SESSION too large");
|
||||||
|
|
||||||
return rb_str_new((const char *) p, len);
|
return rb_str_new((const char *) p, len);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче