Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 7 additions & 2 deletions crates/defguard_core/src/handlers/ssh_authorized_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use defguard_common::db::{
Id,
models::{AuthenticationKey, AuthenticationKeyType},
};
use pgp::composed::{Deserializable, SignedPublicKey};
use serde_json::json;
use sqlx::{Error as SqlxError, PgExecutor, PgPool, query};
use ssh_key::PublicKey;
Expand Down Expand Up @@ -181,8 +182,12 @@ pub async fn add_authentication_key(
return Err(WebError::BadRequest("SSH key failed verification.".into()));
}
}
// FIXME: verify GPG key
AuthenticationKeyType::Gpg => {}
AuthenticationKeyType::Gpg => {
if SignedPublicKey::from_string(trimmed_key).is_err() {
error!("User {username} tried to insert invalid GPG key: {data:?}");
return Err(WebError::BadRequest("GPG key failed verification.".into()));
}
}
}

// check if exists
Expand Down
16 changes: 8 additions & 8 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
}
},
"dependencies": {
"@floating-ui/react": "^0.27.18",
"@floating-ui/react": "^0.27.19",
"@github/webauthn-json": "^2.1.1",
"@hookform/resolvers": "^5.2.2",
"@react-hook/resize-observer": "^2.0.2",
Expand All @@ -61,7 +61,7 @@
"@tanstack/react-virtual": "3.13.12",
"@tanstack/virtual-core": "3.13.12",
"@use-gesture/react": "^10.3.1",
"axios": "^1.13.5",
"axios": "^1.13.6",
"byte-size": "^9.0.1",
"classnames": "^2.5.1",
"clsx": "^2.1.1",
Expand All @@ -79,12 +79,12 @@
"html-react-parser": "^5.2.17",
"humanize-duration": "^3.33.2",
"ipaddr.js": "^2.3.0",
"itertools": "^2.5.0",
"itertools": "^2.6.0",
"js-base64": "^3.7.8",
"lodash-es": "^4.17.23",
"merge-refs": "^2.0.0",
"millify": "^6.1.0",
"motion": "^12.34.0",
"motion": "^12.35.0",
"numbro": "^2.5.0",
"qrcode": "^1.5.4",
"qs": "^6.15.0",
Expand All @@ -93,7 +93,7 @@
"react-click-away-listener": "^2.4.0",
"react-datepicker": "^8.10.0",
"react-dom": "^19.2.4",
"react-hook-form": "^7.71.1",
"react-hook-form": "^7.71.2",
"react-idle-timer": "^5.7.2",
"react-intersection-observer": "^9.16.0",
"react-is": "^19.2.4",
Expand Down Expand Up @@ -128,19 +128,19 @@
"@types/file-saver": "^2.0.7",
"@types/humanize-duration": "^3.27.4",
"@types/lodash-es": "^4.17.12",
"@types/node": "^24.10.13",
"@types/node": "^24.11.0",
"@types/qs": "^6.14.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react-swc": "^4.2.3",
"@vitest/ui": "^4.0.18",
"autoprefixer": "^10.4.24",
"autoprefixer": "^10.4.27",
"concurrently": "^9.2.1",
"dotenv": "^17.3.1",
"esbuild": "^0.25.12",
"globals": "^16.5.0",
"postcss": "^8.5.6",
"postcss": "^8.5.8",
"prettier": "^3.8.1",
"sass": "~1.70.0",
"standard-version": "^9.5.0",
Expand Down
Loading
Loading