exceptions: Make Tlv::Error a base class for all packet-processing exceptions
This commit also includes a number of code style fixes.
Change-Id: I44f83915e733b43d5f43b4266902c8262e928d91
Refs: #1528
diff --git a/src/security/sec-tpm-file.cpp b/src/security/sec-tpm-file.cpp
index 5238ca4..ba3cca8 100644
--- a/src/security/sec-tpm-file.cpp
+++ b/src/security/sec-tpm-file.cpp
@@ -25,7 +25,8 @@
namespace ndn {
-class SecTpmFile::Impl {
+class SecTpmFile::Impl
+{
public:
Impl(const string& dir)
{
@@ -123,7 +124,7 @@
throw Error("Unsupported key type!");
}
}
- catch (const CryptoPP::Exception& e)
+ catch (CryptoPP::Exception& e)
{
throw Error(e.what());
}
@@ -158,7 +159,7 @@
true,
new Base64Decoder(new FileSink(os)));
}
- catch (const CryptoPP::Exception& e)
+ catch (CryptoPP::Exception& e)
{
throw Error(e.what());
}
@@ -191,7 +192,7 @@
new Base64Encoder(new FileSink(keyFileName.c_str())));
return true;
}
- catch (const CryptoPP::Exception& e)
+ catch (CryptoPP::Exception& e)
{
return false;
}
@@ -211,7 +212,7 @@
new Base64Encoder(new FileSink(keyFileName.c_str())));
return true;
}
- catch (const CryptoPP::Exception& e)
+ catch (CryptoPP::Exception& e)
{
return false;
}
@@ -258,7 +259,7 @@
throw Error("Unsupported digest algorithm!");
}
}
- catch (const CryptoPP::Exception& e)
+ catch (CryptoPP::Exception& e)
{
throw Error(e.what());
}
@@ -294,7 +295,7 @@
// return os.buf();
// }
- // catch (const CryptoPP::Exception& e){
+ // catch (CryptoPP::Exception& e){
// throw Error(e.what());
// }
// }
@@ -321,7 +322,7 @@
// // StringSource(data, dataLength, true, new StreamTransformationFilter(decryptor,new FileSink(os)));
// // return os.buf();
- // // }catch (const CryptoPP::Exception& e){
+ // // }catch (CryptoPP::Exception& e){
// // throw Error(e.what());
// // }
// }
@@ -357,7 +358,7 @@
// StringSource(data, dataLength, true, new PK_EncryptorFilter(rng, encryptor, new FileSink(os)));
// return os.buf();
// }
- // catch (const CryptoPP::Exception& e){
+ // catch (CryptoPP::Exception& e){
// throw Error(e.what());
// }
// }
@@ -383,7 +384,7 @@
// // OBufferStream os;
// // StringSource(data, dataLength, true, new StreamTransformationFilter(encryptor, new FileSink(os)));
// // return os.buf();
- // // }catch (const CryptoPP::Exception& e){
+ // // }catch (CryptoPP::Exception& e){
// // throw Error(e.what());
// // }
// }
@@ -420,7 +421,7 @@
// default:
// throw Error("Unsupported symmetric key type!");
// }
- // }catch (const CryptoPP::Exception& e){
+ // }catch (CryptoPP::Exception& e){
// throw Error(e.what());
// }
}
@@ -462,7 +463,7 @@
rng.GenerateBlock(res, size);
return true;
}
- catch (const CryptoPP::Exception& e)
+ catch (CryptoPP::Exception& e)
{
return false;
}