Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/updated gateway registration #4885

Merged
merged 17 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
post-rebasing fixes
  • Loading branch information
jstuczyn committed Sep 18, 2024
commit 114db3c1cf0ba7e8d0081e80dff872f056bfee21
2 changes: 1 addition & 1 deletion common/gateway-storage/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl TryFrom<PersistedSharedKeys> for SharedGatewayKey {
&value.derived_aes256_gcm_siv_key,
&value.derived_aes128_ctr_blake3_hmac_keys_bs58,
) {
(None, None) => Err(StorageError::MissingSharedKey { id: value.id }),
(None, None) => Err(StorageError::MissingSharedKey { id: value.client_id }),
(Some(aes256gcm_siv), _) => {
let current_key = SharedSymmetricKey::try_from_bytes(aes256gcm_siv)
.map_err(|source| StorageError::DataCorruption(source.to_string()))?;
Expand Down
2 changes: 1 addition & 1 deletion common/gateway-storage/src/shared_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl SharedKeysManager {
// we don't want to be using `INSERT OR REPLACE INTO` due to the foreign key on `available_bandwidth` if the entry already exists
sqlx::query!(
r#"
INSERT OR IGNORE INTO shared_keys(client_id, client_address_bs58, derived_aes128_ctr_blake3_hmac_keys_bs58, derived_aes256_gcm_siv_key) VALUES (?, ?, ?);
INSERT OR IGNORE INTO shared_keys(client_id, client_address_bs58, derived_aes128_ctr_blake3_hmac_keys_bs58, derived_aes256_gcm_siv_key) VALUES (?, ?, ?, ?);

UPDATE shared_keys
SET
Expand Down