tangled
alpha
login
or
join now
ptr.pet
/
Allegedly
forked from
microcosm.blue/Allegedly
0
fork
atom
Server tools to backfill, tail, mirror, and verify PLC logs
0
fork
atom
overview
issues
pulls
pipelines
fjall: dont use padded base64url to parse the signatures
ptr.pet
2 weeks ago
e61a3187
6ac66700
verified
This commit was signed with the committer's
known signature
.
ptr.pet
SSH Key Fingerprint:
SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw=
+4
-4
1 changed file
expand all
collapse all
unified
split
src
plc_fjall.rs
+4
-4
src/plc_fjall.rs
···
1
1
use crate::{Dt, ExportPage, Op as CommonOp, PageBoundaryState};
2
2
-
use data_encoding::{BASE32_NOPAD, BASE64URL};
2
2
+
use data_encoding::{BASE32_NOPAD, BASE64URL, BASE64URL_NOPAD};
3
3
use fjall::{Database, Keyspace, KeyspaceCreateOptions, OwnedWriteBatch, PersistMode};
4
4
use serde::{Deserialize, Serialize};
5
5
use std::collections::BTreeMap;
···
86
86
87
87
impl Signature {
88
88
fn from_base64url(s: &str) -> anyhow::Result<Self> {
89
89
-
BASE64URL
89
89
+
BASE64URL_NOPAD
90
90
.decode(s.as_bytes())
91
91
.map(Self)
92
92
-
.map_err(|e| anyhow::anyhow!("invalid base64url sig: {e}"))
92
92
+
.map_err(|e| anyhow::anyhow!("invalid base64url sig {s}: {e}"))
93
93
}
94
94
}
95
95
96
96
impl fmt::Display for Signature {
97
97
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
98
98
-
f.write_str(&BASE64URL.encode(&self.0))
98
98
+
f.write_str(&BASE64URL_NOPAD.encode(&self.0))
99
99
}
100
100
}
101
101