Skip to content

Commit

Permalink
Script language fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Apr 25, 2024
1 parent d61d27f commit 3588bd4
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 52 deletions.
6 changes: 1 addition & 5 deletions matlab/src/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ namespace
"mcastAddress",
"mcastPort",
"headers",
"cipher",
"certs",
"verified"};
"certs"};

mxArray* createInfo(const shared_ptr<Ice::ConnectionInfo>& info)
{
Expand Down Expand Up @@ -113,9 +111,7 @@ namespace
if (sslInfo)
{
type = "ssl";
mxSetFieldByNumber(r, 0, Field::Cipher, createStringFromUTF8(sslInfo->cipher));
mxSetFieldByNumber(r, 0, Field::Certs, createCertificateList(sslInfo->certs));
mxSetFieldByNumber(r, 0, Field::Verified, createBool(sslInfo->verified));
}

mxSetFieldByNumber(r, 0, Field::Type, createStringFromUTF8(type));
Expand Down
4 changes: 0 additions & 4 deletions php/src/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,7 @@ IcePHP::connectionInit(void)
INIT_NS_CLASS_ENTRY(ce, "Ice", "SSLConnectionInfo", nullptr);
ce.create_object = handleConnectionInfoAlloc;
sslConnectionInfoClassEntry = zend_register_internal_class_ex(&ce, connectionInfoClassEntry);
zend_declare_property_string(sslConnectionInfoClassEntry, "cipher", sizeof("cipher") - 1, "", ZEND_ACC_PUBLIC);
zend_declare_property_string(sslConnectionInfoClassEntry, "certs", sizeof("certs") - 1, "", ZEND_ACC_PUBLIC);
zend_declare_property_bool(sslConnectionInfoClassEntry, "verified", sizeof("verified") - 1, 0, ZEND_ACC_PUBLIC);

return true;
}
Expand Down Expand Up @@ -585,8 +583,6 @@ IcePHP::createConnectionInfo(zval* zv, const Ice::ConnectionInfoPtr& p)
if (dynamic_pointer_cast<IceSSL::ConnectionInfo>(p))
{
auto info = dynamic_pointer_cast<IceSSL::ConnectionInfo>(p);
add_property_string(zv, "cipher", const_cast<char*>(info->cipher.c_str()));
add_property_bool(zv, "verified", info->verified ? 1 : 0);

zval zarr;
AutoDestroy listDestroyer(&zarr);
Expand Down
4 changes: 2 additions & 2 deletions php/src/Types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2342,8 +2342,8 @@ IcePHP::ClassInfo::marshal(zval* zv, Ice::OutputStream* os, ObjectMap* objectMap

if (Z_TYPE_P(zv) == IS_NULL)
{
shared_ptr<Ice::Value> nil;
os->write(nil);
shared_ptr<Ice::Value> value; // nullptr
os->write(value);
return;
}

Expand Down
32 changes: 0 additions & 32 deletions python/modules/IcePy/ConnectionInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,6 @@ extern "C"
return result.release();
}

#ifdef WIN32
extern "C"
#endif
static PyObject*
sslConnectionInfoGetCipher(ConnectionInfoObject* self, PyObject* /*args*/)
{
auto info = dynamic_pointer_cast<IceSSL::ConnectionInfo>(*self->connectionInfo);
assert(info);
return createString(info->cipher);
}

#ifdef WIN32
extern "C"
#endif
Expand All @@ -230,17 +219,6 @@ extern "C"
return certs;
}

#ifdef WIN32
extern "C"
#endif
static PyObject*
sslConnectionInfoGetVerified(ConnectionInfoObject* self, PyObject* /*args*/)
{
auto info = dynamic_pointer_cast<IceSSL::ConnectionInfo>(*self->connectionInfo);
assert(info);
return info->incoming ? incTrue() : incFalse();
}

static PyGetSetDef ConnectionInfoGetters[] = {
{STRCAST("underlying"),
reinterpret_cast<getter>(connectionInfoGetUnderlying),
Expand Down Expand Up @@ -332,21 +310,11 @@ static PyGetSetDef WSConnectionInfoGetters[] = {
};

static PyGetSetDef SSLConnectionInfoGetters[] = {
{STRCAST("cipher"),
reinterpret_cast<getter>(sslConnectionInfoGetCipher),
0,
PyDoc_STR(STRCAST("negotiated cipher suite")),
0},
{STRCAST("certs"),
reinterpret_cast<getter>(sslConnectionInfoGetCerts),
0,
PyDoc_STR(STRCAST("certificate chain")),
0},
{STRCAST("verified"),
reinterpret_cast<getter>(sslConnectionInfoGetVerified),
0,
PyDoc_STR(STRCAST("certificate chain verification status")),
0},
{0, 0} /* sentinel */
};

Expand Down
4 changes: 2 additions & 2 deletions python/modules/IcePy/Types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3206,8 +3206,8 @@ IcePy::ValueInfo::marshal(PyObject* p, Ice::OutputStream* os, ObjectMap* objectM

if (p == Py_None)
{
std::shared_ptr<Ice::Value> nil;
os->write(nil);
std::shared_ptr<Ice::Value> value; // nulptr
os->write(value);
return;
}

Expand Down
5 changes: 0 additions & 5 deletions ruby/src/IceRuby/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,16 +279,13 @@ IceRuby::createConnectionInfo(const Ice::ConnectionInfoPtr& p)
info = Data_Wrap_Struct(_sslConnectionInfoClass, 0, IceRuby_ConnectionInfo_free, new Ice::ConnectionInfoPtr(p));

IceSSL::ConnectionInfoPtr ssl = dynamic_pointer_cast<IceSSL::ConnectionInfo>(p);
rb_ivar_set(info, rb_intern("@cipher"), createString(ssl->cipher));

Ice::StringSeq encoded;
for (vector<IceSSL::CertificatePtr>::const_iterator i = ssl->certs.begin(); i != ssl->certs.end(); ++i)
{
encoded.push_back((*i)->encode());
}

rb_ivar_set(info, rb_intern("@certs"), stringSeqToArray(encoded));
rb_ivar_set(info, rb_intern("@verified"), ssl->verified ? Qtrue : Qfalse);
}
else if (dynamic_pointer_cast<Ice::IPConnectionInfo>(p))
{
Expand Down Expand Up @@ -407,9 +404,7 @@ IceRuby::initConnection(VALUE iceModule)
//
// Instance members.
//
rb_define_attr(_sslConnectionInfoClass, "cipher", 1, 0);
rb_define_attr(_sslConnectionInfoClass, "certs", 1, 0);
rb_define_attr(_sslConnectionInfoClass, "verified", 1, 0);
}

Ice::ConnectionPtr
Expand Down
4 changes: 2 additions & 2 deletions ruby/src/IceRuby/Types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2066,8 +2066,8 @@ IceRuby::ClassInfo::marshal(VALUE p, Ice::OutputStream* os, ValueMap* valueMap,

if (NIL_P(p))
{
shared_ptr<Ice::Value> nil;
os->write(nil);
shared_ptr<Ice::Value> value; // nullptr
os->write(value);
return;
}

Expand Down

0 comments on commit 3588bd4

Please sign in to comment.