aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/asn1/alg_id.cpp
diff options
context:
space:
mode:
authorDaniel Neus <[email protected]>2016-01-11 11:55:42 +0100
committerDaniel Neus <[email protected]>2016-03-05 19:50:29 +0100
commitf95cd9245d2e889a756b187452dafaf68e795179 (patch)
treed0d8afe2159821f3c89545ea7711fba05c97e720 /src/lib/asn1/alg_id.cpp
parenta3ce0bd1e9e018ea69741c4380bf065cccedec93 (diff)
Remaining cppcheck fixes that are not covered by GH #444
Diffstat (limited to 'src/lib/asn1/alg_id.cpp')
-rw-r--r--src/lib/asn1/alg_id.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/lib/asn1/alg_id.cpp b/src/lib/asn1/alg_id.cpp
index 7d476a225..75ea78c18 100644
--- a/src/lib/asn1/alg_id.cpp
+++ b/src/lib/asn1/alg_id.cpp
@@ -16,32 +16,24 @@ namespace Botan {
* Create an AlgorithmIdentifier
*/
AlgorithmIdentifier::AlgorithmIdentifier(const OID& alg_id,
- const std::vector<byte>& param)
- {
- oid = alg_id;
- parameters = param;
- }
+ const std::vector<byte>& param) : oid(alg_id), parameters(param)
+ {}
/*
* Create an AlgorithmIdentifier
*/
AlgorithmIdentifier::AlgorithmIdentifier(const std::string& alg_id,
- const std::vector<byte>& param)
- {
- oid = OIDS::lookup(alg_id);
- parameters = param;
- }
+ const std::vector<byte>& param) : oid(OIDS::lookup(alg_id)), parameters(param)
+ {}
/*
* Create an AlgorithmIdentifier
*/
AlgorithmIdentifier::AlgorithmIdentifier(const OID& alg_id,
- Encoding_Option option)
+ Encoding_Option option) : oid(alg_id), parameters()
{
const byte DER_NULL[] = { 0x05, 0x00 };
- oid = alg_id;
-
if(option == USE_NULL_PARAM)
parameters += std::pair<const byte*, size_t>(DER_NULL, sizeof(DER_NULL));
}
@@ -50,12 +42,10 @@ AlgorithmIdentifier::AlgorithmIdentifier(const OID& alg_id,
* Create an AlgorithmIdentifier
*/
AlgorithmIdentifier::AlgorithmIdentifier(const std::string& alg_id,
- Encoding_Option option)
+ Encoding_Option option) : oid(OIDS::lookup(alg_id)), parameters()
{
const byte DER_NULL[] = { 0x05, 0x00 };
- oid = OIDS::lookup(alg_id);
-
if(option == USE_NULL_PARAM)
parameters += std::pair<const byte*, size_t>(DER_NULL, sizeof(DER_NULL));
}