@@ -75,9 +75,9 @@ byte_vector FinEIDv3::getCertificateImpl(const CertificateType type) const
7575 *card, type.isAuthentication () ? SELECT_AUTH_CERT_FILE : SELECT_SIGN_CERT_FILE_V3);
7676}
7777
78- byte_vector FinEIDv3::signWithAuthKeyImpl (const byte_vector& pin, const byte_vector& hash) const
78+ byte_vector FinEIDv3::signWithAuthKeyImpl (byte_vector& & pin, const byte_vector& hash) const
7979{
80- return sign (authSignatureAlgorithm ().hashAlgorithm (), hash, pin, AUTH_PIN_REFERENCE,
80+ return sign (authSignatureAlgorithm ().hashAlgorithm (), hash, std::move ( pin) , AUTH_PIN_REFERENCE,
8181 authPinMinMaxLength (), AUTH_KEY_REFERENCE, RSA_PSS_ALGO, 0x00 );
8282}
8383
@@ -91,11 +91,10 @@ const std::set<SignatureAlgorithm>& FinEIDv3::supportedSigningAlgorithms() const
9191 return ELLIPTIC_CURVE_SIGNATURE_ALGOS ();
9292}
9393
94- ElectronicID::Signature FinEIDv3::signWithSigningKeyImpl (const byte_vector& pin,
95- const byte_vector& hash,
94+ ElectronicID::Signature FinEIDv3::signWithSigningKeyImpl (byte_vector&& pin, const byte_vector& hash,
9695 const HashAlgorithm hashAlgo) const
9796{
98- return {sign (hashAlgo, hash, pin, SIGNING_PIN_REFERENCE, signingPinMinMaxLength (),
97+ return {sign (hashAlgo, hash, std::move ( pin) , SIGNING_PIN_REFERENCE, signingPinMinMaxLength (),
9998 SIGNING_KEY_REFERENCE_V3, ECDSA_ALGO, 0x40 ),
10099 {SignatureAlgorithm::ES, hashAlgo}};
101100}
@@ -105,10 +104,9 @@ ElectronicID::PinRetriesRemainingAndMax FinEIDv3::signingPinRetriesLeftImpl() co
105104 return pinRetriesLeft (SIGNING_PIN_REFERENCE);
106105}
107106
108- byte_vector FinEIDv3::sign (const HashAlgorithm hashAlgo, const byte_vector& hash,
109- const byte_vector& pin, byte_type pinReference,
110- PinMinMaxLength pinMinMaxLength, byte_type keyReference,
111- byte_type signatureAlgo, byte_type LE) const
107+ byte_vector FinEIDv3::sign (const HashAlgorithm hashAlgo, const byte_vector& hash, byte_vector&& pin,
108+ byte_type pinReference, PinMinMaxLength pinMinMaxLength,
109+ byte_type keyReference, byte_type signatureAlgo, byte_type LE) const
112110{
113111 if (signatureAlgo != ECDSA_ALGO && hashAlgo.isSHA3 ()) {
114112 THROW (ArgumentFatalError, " No OID for algorithm " + std::string (hashAlgo));
@@ -137,7 +135,7 @@ byte_vector FinEIDv3::sign(const HashAlgorithm hashAlgo, const byte_vector& hash
137135
138136 transmitApduWithExpectedResponse (*card, SELECT_MASTER_FILE);
139137
140- verifyPin (*card, pinReference, pin, pinMinMaxLength.first , pinMinMaxLength.second ,
138+ verifyPin (*card, pinReference, std::move ( pin) , pinMinMaxLength.first , pinMinMaxLength.second ,
141139 PIN_PADDING_CHAR);
142140 // Select security environment for COMPUTE SIGNATURE.
143141 selectSecurityEnv (*card, 0xB6 , signatureAlgo, keyReference, name ());
@@ -198,17 +196,16 @@ byte_vector FinEIDv4::getCertificateImpl(const CertificateType type) const
198196 *card, type.isAuthentication () ? SELECT_AUTH_CERT_FILE : SELECT_SIGN_CERT_FILE_V4);
199197}
200198
201- byte_vector FinEIDv4::signWithAuthKeyImpl (const byte_vector& pin, const byte_vector& hash) const
199+ byte_vector FinEIDv4::signWithAuthKeyImpl (byte_vector& & pin, const byte_vector& hash) const
202200{
203- return sign (authSignatureAlgorithm ().hashAlgorithm (), hash, pin, AUTH_PIN_REFERENCE,
201+ return sign (authSignatureAlgorithm ().hashAlgorithm (), hash, std::move ( pin) , AUTH_PIN_REFERENCE,
204202 authPinMinMaxLength (), AUTH_KEY_REFERENCE, ECDSA_ALGO, 0x60 );
205203}
206204
207- ElectronicID::Signature FinEIDv4::signWithSigningKeyImpl (const byte_vector& pin,
208- const byte_vector& hash,
205+ ElectronicID::Signature FinEIDv4::signWithSigningKeyImpl (byte_vector&& pin, const byte_vector& hash,
209206 const HashAlgorithm hashAlgo) const
210207{
211- return {sign (hashAlgo, hash, pin, SIGNING_PIN_REFERENCE, signingPinMinMaxLength (),
208+ return {sign (hashAlgo, hash, std::move ( pin) , SIGNING_PIN_REFERENCE, signingPinMinMaxLength (),
212209 SIGNING_KEY_REFERENCE_V4, ECDSA_ALGO, 0x60 ),
213210 {SignatureAlgorithm::ES, hashAlgo}};
214211}
0 commit comments