Skip to content

Commit ff3704b

Browse files
committed
chore(keystore): use named params in credential insertion
1 parent f7fc6f4 commit ff3704b

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

keystore/src/entities/platform/generic/mls/credential.rs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{
55
};
66

77
use async_trait::async_trait;
8-
use rusqlite::{OptionalExtension as _, Row, Transaction, named_params, params};
8+
use rusqlite::{OptionalExtension as _, Row, Transaction, named_params};
99

1010
use crate::{
1111
CryptoKeystoreError, CryptoKeystoreResult, Sha256Hash,
@@ -157,16 +157,24 @@ impl<'a> EntityDatabaseMutation<'a> for StoredCredential {
157157
created_at,
158158
ciphersuite,
159159
private_key
160-
) VALUES (?, ?, ?, ?, datetime(?, 'unixepoch'), ?, ?)",
160+
) VALUES (
161+
:public_key_sha256,
162+
:public_key,
163+
:session_id,
164+
:credential,
165+
datetime(:created_at, 'unixepoch'),
166+
:ciphersuite,
167+
:private_key
168+
)",
161169
)?;
162-
stmt.execute(params![
163-
self.primary_key(),
164-
self.public_key,
165-
self.session_id,
166-
self.credential,
167-
self.created_at,
168-
self.ciphersuite,
169-
self.private_key,
170+
stmt.execute(named_params![
171+
":public_key_sha256": self.primary_key(),
172+
":public_key": self.public_key,
173+
":session_id": self.session_id,
174+
":credential": self.credential,
175+
":created_at": self.created_at,
176+
":ciphersuite": self.ciphersuite,
177+
":private_key": self.private_key,
170178
])?;
171179

172180
Ok(())

0 commit comments

Comments
 (0)