src: Making use of DEPRECATED macro and updating library code not to use deprecated methods
Change-Id: Ibe17977e7fcbb759a26dbe1cfa3d472598e49bcc
diff --git a/src/security/identity-certificate.cpp b/src/security/identity-certificate.cpp
index 33e1e71..b3c544a 100644
--- a/src/security/identity-certificate.cpp
+++ b/src/security/identity-certificate.cpp
@@ -26,7 +26,7 @@
string idString("ID-CERT");
int i = name.size() - 1;
for (; i >= 0; i--) {
- if (name.get(i).toEscapedString() == idString)
+ if (name.get(i).toUri() == idString)
break;
}
@@ -36,7 +36,7 @@
string keyString("KEY");
size_t keyIndex = 0;
for (; keyIndex < name.size(); keyIndex++) {
- if (name.get(keyIndex).toEscapedString() == keyString)
+ if (name.get(keyIndex).toUri() == keyString)
break;
}
@@ -68,7 +68,7 @@
bool foundIdString = false;
size_t idCertComponentIndex = certificateName.size() - 1;
for (; idCertComponentIndex + 1 > 0; --idCertComponentIndex) {
- if (certificateName.get(idCertComponentIndex).toEscapedString() == idString)
+ if (certificateName.get(idCertComponentIndex).toUri() == idString)
{
foundIdString = true;
break;
@@ -83,7 +83,7 @@
bool foundKeyString = false;
size_t keyComponentIndex = 0;
for (; keyComponentIndex < tmpName.size(); keyComponentIndex++) {
- if (tmpName.get(keyComponentIndex).toEscapedString() == keyString)
+ if (tmpName.get(keyComponentIndex).toUri() == keyString)
{
foundKeyString = true;
break;
diff --git a/src/security/key-chain.cpp b/src/security/key-chain.cpp
index 67cdda6..18051c1 100644
--- a/src/security/key-chain.cpp
+++ b/src/security/key-chain.cpp
@@ -116,7 +116,7 @@
if (keyName.size() < 1)
return shared_ptr<IdentityCertificate>();
- std::string keyIdPrefix = keyName.get(-1).toEscapedString().substr(0, 4);
+ std::string keyIdPrefix = keyName.get(-1).toUri().substr(0, 4);
if (keyIdPrefix != "ksk-" && keyIdPrefix != "dsk-")
return shared_ptr<IdentityCertificate>();
diff --git a/src/security/sec-public-info-sqlite3.cpp b/src/security/sec-public-info-sqlite3.cpp
index 7f248d5..86256f8 100644
--- a/src/security/sec-public-info-sqlite3.cpp
+++ b/src/security/sec-public-info-sqlite3.cpp
@@ -233,7 +233,7 @@
if (keyName.empty())
throw Error("Incorrect key name " + keyName.toUri());
- string keyId = keyName.get(-1).toEscapedString();
+ string keyId = keyName.get(-1).toUri();
Name identityName = keyName.getPrefix(-1);
sqlite3_stmt* statement;
@@ -269,7 +269,7 @@
if (doesPublicKeyExist(keyName))
return;
- string keyId = keyName.get(-1).toEscapedString();
+ string keyId = keyName.get(-1).toUri();
Name identityName = keyName.getPrefix(-1);
addIdentity(identityName);
@@ -302,7 +302,7 @@
throw Error("SecPublicInfoSqlite3::getPublicKey Empty keyName");
}
- string keyId = keyName.get(-1).toEscapedString();
+ string keyId = keyName.get(-1).toUri();
Name identityName = keyName.getPrefix(-1);
sqlite3_stmt* statement;
@@ -364,7 +364,7 @@
// if (keyName.empty())
// return;
-// std::string keyId = keyName.get(-1).toEscapedString();
+// std::string keyId = keyName.get(-1).toUri();
// std::string identityName = keyName.getPrefix(-1).toUri();
// sqlite3_stmt* statement;
@@ -421,7 +421,7 @@
if (doesCertificateExist(certificateName))
return;
- string keyId = keyName.get(-1).toEscapedString();
+ string keyId = keyName.get(-1).toUri();
Name identity = keyName.getPrefix(-1);
// Insert the certificate
@@ -585,7 +585,7 @@
if (!doesPublicKeyExist(keyName))
throw Error("Key does not exist:" + keyName.toUri());
- string keyId = keyName.get(-1).toEscapedString();
+ string keyId = keyName.get(-1).toUri();
Name identityName = keyName.getPrefix(-1);
sqlite3_stmt* statement;
@@ -622,7 +622,7 @@
if (keyName.empty())
throw Error("SecPublicInfoSqlite3::getDefaultCertificateNameForKey wrong key");
- string keyId = keyName.get(-1).toEscapedString();
+ string keyId = keyName.get(-1).toUri();
Name identityName = keyName.getPrefix(-1);
sqlite3_stmt* statement;
@@ -657,7 +657,7 @@
throw Error("certificate does not exist:" + certificateName.toUri());
Name keyName = IdentityCertificate::certificateNameToPublicKeyName(certificateName);
- string keyId = keyName.get(-1).toEscapedString();
+ string keyId = keyName.get(-1).toUri();
Name identityName = keyName.getPrefix(-1);
sqlite3_stmt* statement;
@@ -812,7 +812,7 @@
Name identity = keyName.getPrefix(-1);
sqlite3_bind_text(stmt, 1, identity.toUri().c_str(), identity.toUri().size (), SQLITE_TRANSIENT);
- std::string baseKeyName = keyName.get(-1).toEscapedString();
+ std::string baseKeyName = keyName.get(-1).toUri();
sqlite3_bind_text(stmt, 2, baseKeyName.c_str(), baseKeyName.size(), SQLITE_TRANSIENT);
while (sqlite3_step(stmt) == SQLITE_ROW)
@@ -842,7 +842,7 @@
return;
string identity = keyName.getPrefix(-1).toUri();
- string keyId = keyName.get(-1).toEscapedString();
+ string keyId = keyName.get(-1).toUri();
sqlite3_stmt* stmt;
sqlite3_prepare_v2(m_database,