From 1df42597d15416357a20bd68700ce1a2d245e8bb Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 7 Mar 2011 08:44:45 +0000 Subject: cancel subversion backfire. sorry git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl_cipher.c | 2 +- ext/openssl/ossl_ns_spki.c | 8 ++++---- ext/openssl/ossl_ocsp.c | 48 ++++++++++++++++++++++----------------------- ext/openssl/ossl_pkcs12.c | 12 ++++++------ ext/openssl/ossl_pkcs7.c | 38 +++++++++++++++++------------------ ext/openssl/ossl_pkey.h | 16 +++++++-------- ext/openssl/ossl_pkey_dh.c | 4 ++-- ext/openssl/ossl_pkey_dsa.c | 4 ++-- 8 files changed, 66 insertions(+), 66 deletions(-) (limited to 'ext/openssl') diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c index 84b51a0101..485626fe62 100644 --- a/ext/openssl/ossl_cipher.c +++ b/ext/openssl/ossl_cipher.c @@ -202,7 +202,7 @@ ossl_cipher_init(int argc, VALUE *argv, VALUE self, int mode) * keeping this behaviour for backward compatibility. */ const char *cname = rb_class2name(rb_obj_class(self)); - rb_warn("argumtents for %s#encrypt and %s#decrypt were deprecated; " + rb_warn("arguments for %s#encrypt and %s#decrypt were deprecated; " "use %s#pkcs5_keyivgen to derive key and IV", cname, cname, cname); StringValue(pass); diff --git a/ext/openssl/ossl_ns_spki.c b/ext/openssl/ossl_ns_spki.c index b67dd225a1..fde8957206 100644 --- a/ext/openssl/ossl_ns_spki.c +++ b/ext/openssl/ossl_ns_spki.c @@ -11,14 +11,14 @@ #include "ossl.h" #define WrapSPKI(klass, obj, spki) do { \ - if (!spki) { \ + if (!(spki)) { \ ossl_raise(rb_eRuntimeError, "SPKI wasn't initialized!"); \ } \ - obj = Data_Wrap_Struct(klass, 0, NETSCAPE_SPKI_free, spki); \ + (obj) = Data_Wrap_Struct((klass), 0, NETSCAPE_SPKI_free, (spki)); \ } while (0) #define GetSPKI(obj, spki) do { \ - Data_Get_Struct(obj, NETSCAPE_SPKI, spki); \ - if (!spki) { \ + Data_Get_Struct((obj), NETSCAPE_SPKI, (spki)); \ + if (!(spki)) { \ ossl_raise(rb_eRuntimeError, "SPKI wasn't initialized!"); \ } \ } while (0) diff --git a/ext/openssl/ossl_ocsp.c b/ext/openssl/ossl_ocsp.c index fb01243261..dc4d4fb2af 100644 --- a/ext/openssl/ossl_ocsp.c +++ b/ext/openssl/ossl_ocsp.c @@ -14,55 +14,55 @@ #if defined(OSSL_OCSP_ENABLED) #define WrapOCSPReq(klass, obj, req) do { \ - if(!req) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \ - obj = Data_Wrap_Struct(klass, 0, OCSP_REQUEST_free, req); \ + if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \ + (obj) = Data_Wrap_Struct((klass), 0, OCSP_REQUEST_free, (req)); \ } while (0) #define GetOCSPReq(obj, req) do { \ - Data_Get_Struct(obj, OCSP_REQUEST, req); \ - if(!req) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \ + Data_Get_Struct((obj), OCSP_REQUEST, (req)); \ + if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \ } while (0) #define SafeGetOCSPReq(obj, req) do { \ - OSSL_Check_Kind(obj, cOCSPReq); \ - GetOCSPReq(obj, req); \ + OSSL_Check_Kind((obj), cOCSPReq); \ + GetOCSPReq((obj), (req)); \ } while (0) #define WrapOCSPRes(klass, obj, res) do { \ - if(!res) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \ - obj = Data_Wrap_Struct(klass, 0, OCSP_RESPONSE_free, res); \ + if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \ + (obj) = Data_Wrap_Struct((klass), 0, OCSP_RESPONSE_free, (res)); \ } while (0) #define GetOCSPRes(obj, res) do { \ - Data_Get_Struct(obj, OCSP_RESPONSE, res); \ - if(!res) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \ + Data_Get_Struct((obj), OCSP_RESPONSE, (res)); \ + if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \ } while (0) #define SafeGetOCSPRes(obj, res) do { \ - OSSL_Check_Kind(obj, cOCSPRes); \ - GetOCSPRes(obj, res); \ + OSSL_Check_Kind((obj), cOCSPRes); \ + GetOCSPRes((obj), (res)); \ } while (0) #define WrapOCSPBasicRes(klass, obj, res) do { \ - if(!res) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \ - obj = Data_Wrap_Struct(klass, 0, OCSP_BASICRESP_free, res); \ + if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \ + (obj) = Data_Wrap_Struct((klass), 0, OCSP_BASICRESP_free, (res)); \ } while (0) #define GetOCSPBasicRes(obj, res) do { \ - Data_Get_Struct(obj, OCSP_BASICRESP, res); \ - if(!res) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \ + Data_Get_Struct((obj), OCSP_BASICRESP, (res)); \ + if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \ } while (0) #define SafeGetOCSPBasicRes(obj, res) do { \ - OSSL_Check_Kind(obj, cOCSPBasicRes); \ - GetOCSPBasicRes(obj, res); \ + OSSL_Check_Kind((obj), cOCSPBasicRes); \ + GetOCSPBasicRes((obj), (res)); \ } while (0) #define WrapOCSPCertId(klass, obj, cid) do { \ - if(!cid) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \ - obj = Data_Wrap_Struct(klass, 0, OCSP_CERTID_free, cid); \ + if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \ + (obj) = Data_Wrap_Struct((klass), 0, OCSP_CERTID_free, (cid)); \ } while (0) #define GetOCSPCertId(obj, cid) do { \ - Data_Get_Struct(obj, OCSP_CERTID, cid); \ - if(!cid) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \ + Data_Get_Struct((obj), OCSP_CERTID, (cid)); \ + if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \ } while (0) #define SafeGetOCSPCertId(obj, cid) do { \ - OSSL_Check_Kind(obj, cOCSPCertId); \ - GetOCSPCertId(obj, cid); \ + OSSL_Check_Kind((obj), cOCSPCertId); \ + GetOCSPCertId((obj), (cid)); \ } while (0) VALUE mOCSP; diff --git a/ext/openssl/ossl_pkcs12.c b/ext/openssl/ossl_pkcs12.c index 85e092b251..3628374b4e 100644 --- a/ext/openssl/ossl_pkcs12.c +++ b/ext/openssl/ossl_pkcs12.c @@ -6,18 +6,18 @@ #include "ossl.h" #define WrapPKCS12(klass, obj, p12) do { \ - if(!p12) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \ - obj = Data_Wrap_Struct(klass, 0, PKCS12_free, p12); \ + if(!(p12)) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \ + (obj) = Data_Wrap_Struct((klass), 0, PKCS12_free, (p12)); \ } while (0) #define GetPKCS12(obj, p12) do { \ - Data_Get_Struct(obj, PKCS12, p12); \ - if(!p12) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \ + Data_Get_Struct((obj), PKCS12, (p12)); \ + if(!(p12)) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \ } while (0) #define SafeGetPKCS12(obj, p12) do { \ - OSSL_Check_Kind(obj, cPKCS12); \ - GetPKCS12(obj, p12); \ + OSSL_Check_Kind((obj), cPKCS12); \ + GetPKCS12((obj), (p12)); \ } while (0) #define ossl_pkcs12_set_key(o,v) rb_iv_set((o), "@key", (v)) diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c index 9842d4e941..e25c8bc5c1 100644 --- a/ext/openssl/ossl_pkcs7.c +++ b/ext/openssl/ossl_pkcs7.c @@ -11,57 +11,57 @@ #include "ossl.h" #define WrapPKCS7(klass, obj, pkcs7) do { \ - if (!pkcs7) { \ + if (!(pkcs7)) { \ ossl_raise(rb_eRuntimeError, "PKCS7 wasn't initialized."); \ } \ - obj = Data_Wrap_Struct(klass, 0, PKCS7_free, pkcs7); \ + (obj) = Data_Wrap_Struct((klass), 0, PKCS7_free, (pkcs7)); \ } while (0) #define GetPKCS7(obj, pkcs7) do { \ - Data_Get_Struct(obj, PKCS7, pkcs7); \ - if (!pkcs7) { \ + Data_Get_Struct((obj), PKCS7, (pkcs7)); \ + if (!(pkcs7)) { \ ossl_raise(rb_eRuntimeError, "PKCS7 wasn't initialized."); \ } \ } while (0) #define SafeGetPKCS7(obj, pkcs7) do { \ - OSSL_Check_Kind(obj, cPKCS7); \ - GetPKCS7(obj, pkcs7); \ + OSSL_Check_Kind((obj), cPKCS7); \ + GetPKCS7((obj), (pkcs7)); \ } while (0) #define WrapPKCS7si(klass, obj, p7si) do { \ - if (!p7si) { \ + if (!(p7si)) { \ ossl_raise(rb_eRuntimeError, "PKCS7si wasn't initialized."); \ } \ - obj = Data_Wrap_Struct(klass, 0, PKCS7_SIGNER_INFO_free, p7si); \ + (obj) = Data_Wrap_Struct((klass), 0, PKCS7_SIGNER_INFO_free, (p7si)); \ } while (0) #define GetPKCS7si(obj, p7si) do { \ - Data_Get_Struct(obj, PKCS7_SIGNER_INFO, p7si); \ - if (!p7si) { \ + Data_Get_Struct((obj), PKCS7_SIGNER_INFO, (p7si)); \ + if (!(p7si)) { \ ossl_raise(rb_eRuntimeError, "PKCS7si wasn't initialized."); \ } \ } while (0) #define SafeGetPKCS7si(obj, p7si) do { \ - OSSL_Check_Kind(obj, cPKCS7Signer); \ - GetPKCS7si(obj, p7si); \ + OSSL_Check_Kind((obj), cPKCS7Signer); \ + GetPKCS7si((obj), (p7si)); \ } while (0) #define WrapPKCS7ri(klass, obj, p7ri) do { \ - if (!p7ri) { \ + if (!(p7ri)) { \ ossl_raise(rb_eRuntimeError, "PKCS7ri wasn't initialized."); \ } \ - obj = Data_Wrap_Struct(klass, 0, PKCS7_RECIP_INFO_free, p7ri); \ + (obj) = Data_Wrap_Struct((klass), 0, PKCS7_RECIP_INFO_free, (p7ri)); \ } while (0) #define GetPKCS7ri(obj, p7ri) do { \ - Data_Get_Struct(obj, PKCS7_RECIP_INFO, p7ri); \ - if (!p7ri) { \ + Data_Get_Struct((obj), PKCS7_RECIP_INFO, (p7ri)); \ + if (!(p7ri)) { \ ossl_raise(rb_eRuntimeError, "PKCS7ri wasn't initialized."); \ } \ } while (0) #define SafeGetPKCS7ri(obj, p7ri) do { \ - OSSL_Check_Kind(obj, cPKCS7Recipient); \ - GetPKCS7ri(obj, p7ri); \ + OSSL_Check_Kind((obj), cPKCS7Recipient); \ + GetPKCS7ri((obj), (p7ri)); \ } while (0) -#define numberof(ary) (int)(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_get_data(o) rb_iv_get((o), "@data") diff --git a/ext/openssl/ossl_pkey.h b/ext/openssl/ossl_pkey.h index 67ff1fddd0..5e3329d326 100644 --- a/ext/openssl/ossl_pkey.h +++ b/ext/openssl/ossl_pkey.h @@ -21,21 +21,21 @@ extern ID id_private_q; #define OSSL_PKEY_IS_PRIVATE(obj) (rb_iv_get((obj), "private") == Qtrue) #define WrapPKey(klass, obj, pkey) do { \ - if (!pkey) { \ + if (!(pkey)) { \ rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!"); \ } \ - obj = Data_Wrap_Struct(klass, 0, EVP_PKEY_free, pkey); \ + (obj) = Data_Wrap_Struct((klass), 0, EVP_PKEY_free, (pkey)); \ OSSL_PKEY_SET_PUBLIC(obj); \ } while (0) #define GetPKey(obj, pkey) do {\ - Data_Get_Struct(obj, EVP_PKEY, pkey);\ - if (!pkey) { \ + Data_Get_Struct((obj), EVP_PKEY, (pkey));\ + if (!(pkey)) { \ rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!");\ } \ } while (0) #define SafeGetPKey(obj, pkey) do { \ - OSSL_Check_Kind(obj, cPKey); \ - GetPKey(obj, pkey); \ + OSSL_Check_Kind((obj), cPKey); \ + GetPKey((obj), (pkey)); \ } while (0) void ossl_generate_cb(int, int, void *); @@ -134,8 +134,8 @@ static VALUE ossl_##keytype##_set_##name(VALUE self, VALUE bignum) \ #define DEF_OSSL_PKEY_BN(class, keytype, name) \ do { \ - rb_define_method(class, #name, ossl_##keytype##_get_##name, 0); \ - rb_define_method(class, #name "=", ossl_##keytype##_set_##name, 1);\ + rb_define_method((class), #name, ossl_##keytype##_get_##name, 0); \ + rb_define_method((class), #name "=", ossl_##keytype##_set_##name, 1);\ } while (0) #endif /* _OSSL_PKEY_H_ */ diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c index 5ea575eaf9..4311fa1e96 100644 --- a/ext/openssl/ossl_pkey_dh.c +++ b/ext/openssl/ossl_pkey_dh.c @@ -13,8 +13,8 @@ #include "ossl.h" #define GetPKeyDH(obj, pkey) do { \ - GetPKey(obj, pkey); \ - if (EVP_PKEY_type(pkey->type) != EVP_PKEY_DH) { /* PARANOIA? */ \ + GetPKey((obj), (pkey)); \ + if (EVP_PKEY_type((pkey)->type) != EVP_PKEY_DH) { /* PARANOIA? */ \ ossl_raise(rb_eRuntimeError, "THIS IS NOT A DH!") ; \ } \ } while (0) diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c index e66f4ed009..65550ca351 100644 --- a/ext/openssl/ossl_pkey_dsa.c +++ b/ext/openssl/ossl_pkey_dsa.c @@ -13,8 +13,8 @@ #include "ossl.h" #define GetPKeyDSA(obj, pkey) do { \ - GetPKey(obj, pkey); \ - if (EVP_PKEY_type(pkey->type) != EVP_PKEY_DSA) { /* PARANOIA? */ \ + GetPKey((obj), (pkey)); \ + if (EVP_PKEY_type((pkey)->type) != EVP_PKEY_DSA) { /* PARANOIA? */ \ ossl_raise(rb_eRuntimeError, "THIS IS NOT A DSA!"); \ } \ } while (0) -- cgit v1.2.3