Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Mar 22, 2024
1 parent cd9e1c0 commit 80e25a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"url": "https://github.com/serprex/openEtG"
},
"devDependencies": {
"@babel/plugin-syntax-import-attributes": "^7.23.3",
"@babel/plugin-syntax-import-attributes": "^7.24.1",
"@pencil.js/spritesheet": "^1.5.1",
"babel-loader": "^9.1.3",
"babel-preset-solid": "^1.8.15",
"babel-preset-solid": "^1.8.16",
"copy-webpack-plugin": "^12.0.2",
"html-webpack-plugin": "^5.6.0",
"prettier": "^3.2.5",
"solid-js": "^1.8.15",
"webpack": "^5.90.3",
"solid-js": "^1.8.16",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/rs/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ opt-level = 1
lto = "thin"

[dependencies]
base64 = { version = "0.21", default-features = false }
base64 = { version = "0.22", default-features = false, features = ["alloc"] }
bb8-postgres = { version = "0.8", features = ["with-serde_json-1"] }
brotli = { version = "3", default-features = false, features = ["std"] }
etg = { version = "0.1", default-features = false, path = "../" }
Expand Down
12 changes: 6 additions & 6 deletions src/rs/server/src/handlews.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::num::NonZeroUsize;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;

use base64::engine::{general_purpose::STANDARD_NO_PAD, Engine};
use base64::prelude::*;
use bb8_postgres::tokio_postgres::{
types::{Json, ToSql},
Client, GenericClient,
Expand Down Expand Up @@ -1439,7 +1439,8 @@ pub async fn handle_ws(
p.as_bytes(),
&mut keybuf,
);
user.auth = STANDARD_NO_PAD.encode(&mut keybuf[..]);
user.auth.clear();
BASE64_STANDARD_NO_PAD.encode_string(&keybuf[..], &mut user.auth);
}
if client.execute(
"update users set auth = $2, salt = $3, iter = $4, algo = $5 where id = $1",
Expand Down Expand Up @@ -2286,13 +2287,12 @@ pub async fn handle_ws(
psw.as_bytes(),
&mut keybuf,
);
let realkey = user.auth.as_bytes();
if realkey.is_empty() {
user.auth = STANDARD_NO_PAD.encode(&mut keybuf[..]);
if user.auth.is_empty() {
user.auth = BASE64_STANDARD_NO_PAD.encode(&keybuf[..]);
true
} else {
let mut realkeybuf = [0u8; 64];
STANDARD_NO_PAD
BASE64_STANDARD_NO_PAD
.decode_slice_unchecked(user.auth.as_bytes(), &mut realkeybuf)
.ok();
keybuf == realkeybuf
Expand Down

0 comments on commit 80e25a0

Please sign in to comment.