Compare commits
3 Commits
eb42cd629e
...
8af3018b34
Author | SHA1 | Date | |
---|---|---|---|
8af3018b34 | |||
dd96cc4bf3 | |||
9e9a227332 |
@@ -16,11 +16,13 @@ impl CRLDistributionPointExt {
|
|||||||
let crl_bytes = asn1::write(|w| {
|
let crl_bytes = asn1::write(|w| {
|
||||||
w.write_element(&asn1::SequenceWriter::new(&|w| {
|
w.write_element(&asn1::SequenceWriter::new(&|w| {
|
||||||
w.write_element(&asn1::SequenceWriter::new(&|w| {
|
w.write_element(&asn1::SequenceWriter::new(&|w| {
|
||||||
w.write_tlv(tag_a0, |w| {
|
w.write_tlv(tag_a0, None, |w: &mut asn1::WriteBuf| {
|
||||||
w.push_slice(&asn1::write(|w| {
|
w.push_slice(&asn1::write(|w| {
|
||||||
w.write_tlv(tag_a0, |w| {
|
w.write_tlv(tag_a0, None, |w: &mut asn1::WriteBuf| {
|
||||||
w.push_slice(&asn1::write(|w| {
|
w.push_slice(&asn1::write(|w| {
|
||||||
w.write_tlv(tag_86, |b| b.push_slice(self.url.as_bytes()))?;
|
w.write_tlv(tag_86, None, |b| {
|
||||||
|
b.push_slice(self.url.as_bytes())
|
||||||
|
})?;
|
||||||
Ok(())
|
Ok(())
|
||||||
})?)
|
})?)
|
||||||
})?;
|
})?;
|
||||||
|
@@ -174,17 +174,16 @@ fn gen_certificate(req: GenCertificateReq) -> anyhow::Result<(Option<Vec<u8>>, V
|
|||||||
cert_builder.set_not_after(¬_after)?;
|
cert_builder.set_not_after(¬_after)?;
|
||||||
|
|
||||||
// Specify CRL URL
|
// Specify CRL URL
|
||||||
if let Some(issuer) = req.issuer {
|
if let Some(issuer) = req.issuer
|
||||||
if let Some(crl) = &issuer.crl {
|
&& let Some(crl) = &issuer.crl
|
||||||
|
{
|
||||||
let crl_url = format!(
|
let crl_url = format!(
|
||||||
"{}/pki/{}",
|
"{}/pki/{}",
|
||||||
AppConfig::get().unsecure_origin(),
|
AppConfig::get().unsecure_origin(),
|
||||||
crl.file_name().unwrap().to_string_lossy()
|
crl.file_name().unwrap().to_string_lossy()
|
||||||
);
|
);
|
||||||
|
|
||||||
cert_builder
|
cert_builder.append_extension(CRLDistributionPointExt { url: crl_url }.as_extension()?)?;
|
||||||
.append_extension(CRLDistributionPointExt { url: crl_url }.as_extension()?)?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If cert is a CA or not
|
// If cert is a CA or not
|
||||||
@@ -424,15 +423,15 @@ fn refresh_crl(d: &CertData, new_cert: Option<&X509>) -> anyhow::Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add old entries
|
// Add old entries
|
||||||
if let Some(old_crl) = old_crl {
|
if let Some(old_crl) = old_crl
|
||||||
if let Some(entries) = old_crl.get_revoked() {
|
&& let Some(entries) = old_crl.get_revoked()
|
||||||
|
{
|
||||||
for entry in entries {
|
for entry in entries {
|
||||||
if X509_CRL_add0_revoked(crl, X509_REVOKED_dup(entry.as_ptr())) == 0 {
|
if X509_CRL_add0_revoked(crl, X509_REVOKED_dup(entry.as_ptr())) == 0 {
|
||||||
return Err(PKIError::GenCRLError("X509_CRL_add0_revoked").into());
|
return Err(PKIError::GenCRLError("X509_CRL_add0_revoked").into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// If requested, add new entry
|
// If requested, add new entry
|
||||||
if let Some(new_cert) = new_cert {
|
if let Some(new_cert) = new_cert {
|
||||||
|
@@ -155,13 +155,12 @@ pub async fn sync_device(body: web::Json<JWTRequest>, actor: WebEnergyActor) ->
|
|||||||
let mut available_update = None;
|
let mut available_update = None;
|
||||||
|
|
||||||
// Check if the version is available
|
// Check if the version is available
|
||||||
if let Some(desired) = device.desired_version {
|
if let Some(desired) = device.desired_version
|
||||||
if claims.info.version < desired
|
&& claims.info.version < desired
|
||||||
&& ota_manager::update_exists(OTAPlatform::from_str(&claims.info.reference)?, &desired)?
|
&& ota_manager::update_exists(OTAPlatform::from_str(&claims.info.reference)?, &desired)?
|
||||||
{
|
{
|
||||||
available_update = Some(desired);
|
available_update = Some(desired);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Ok(HttpResponse::Ok().json(SyncResult {
|
Ok(HttpResponse::Ok().json(SyncResult {
|
||||||
relays,
|
relays,
|
||||||
|
@@ -123,18 +123,18 @@ pub async fn set_desired_version(
|
|||||||
|
|
||||||
for d in devices {
|
for d in devices {
|
||||||
// Filter per platform
|
// Filter per platform
|
||||||
if let Some(p) = body.platform {
|
if let Some(p) = body.platform
|
||||||
if d.info.reference != p.to_string() {
|
&& d.info.reference != p.to_string()
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Filter per device
|
// Filter per device
|
||||||
if let Some(ids) = &body.devices {
|
if let Some(ids) = &body.devices
|
||||||
if !ids.contains(&d.id) {
|
&& !ids.contains(&d.id)
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
actor
|
actor
|
||||||
.send(energy_actor::SetDesiredVersion(
|
.send(energy_actor::SetDesiredVersion(
|
||||||
|
95
central_frontend/package-lock.json
generated
95
central_frontend/package-lock.json
generated
@@ -30,7 +30,7 @@
|
|||||||
"@types/react-dom": "^19.1.7",
|
"@types/react-dom": "^19.1.7",
|
||||||
"@types/semver": "^7.7.0",
|
"@types/semver": "^7.7.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
||||||
"@typescript-eslint/parser": "^8.37.0",
|
"@typescript-eslint/parser": "^8.41.0",
|
||||||
"@vitejs/plugin-react": "^4.7.0",
|
"@vitejs/plugin-react": "^4.7.0",
|
||||||
"eslint": "^9.33.0",
|
"eslint": "^9.33.0",
|
||||||
"eslint-plugin-react-hooks": "^5.2.0",
|
"eslint-plugin-react-hooks": "^5.2.0",
|
||||||
@@ -2349,16 +2349,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser": {
|
"node_modules/@typescript-eslint/parser": {
|
||||||
"version": "8.39.1",
|
"version": "8.41.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.39.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.41.0.tgz",
|
||||||
"integrity": "sha512-pUXGCuHnnKw6PyYq93lLRiZm3vjuslIy7tus1lIQTYVK9bL8XBgJnCWm8a0KcTtHC84Yya1Q6rtll+duSMj0dg==",
|
"integrity": "sha512-gTtSdWX9xiMPA/7MV9STjJOOYtWwIJIYxkQxnSV1U3xcE+mnJSH3f6zI0RYP+ew66WSlZ5ed+h0VCxsvdC1jJg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "8.39.1",
|
"@typescript-eslint/scope-manager": "8.41.0",
|
||||||
"@typescript-eslint/types": "8.39.1",
|
"@typescript-eslint/types": "8.41.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.39.1",
|
"@typescript-eslint/typescript-estree": "8.41.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.39.1",
|
"@typescript-eslint/visitor-keys": "8.41.0",
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -2373,15 +2373,37 @@
|
|||||||
"typescript": ">=4.8.4 <6.0.0"
|
"typescript": ">=4.8.4 <6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": {
|
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/project-service": {
|
||||||
"version": "8.39.1",
|
"version": "8.41.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.39.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.41.0.tgz",
|
||||||
"integrity": "sha512-RkBKGBrjgskFGWuyUGz/EtD8AF/GW49S21J8dvMzpJitOF1slLEbbHnNEtAHtnDAnx8qDEdRrULRnWVx27wGBw==",
|
"integrity": "sha512-b8V9SdGBQzQdjJ/IO3eDifGpDBJfvrNTp2QD9P2BeqWTGrRibgfgIlBSw6z3b6R7dPzg752tOs4u/7yCLxksSQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.39.1",
|
"@typescript-eslint/tsconfig-utils": "^8.41.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.39.1"
|
"@typescript-eslint/types": "^8.41.0",
|
||||||
|
"debug": "^4.3.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": ">=4.8.4 <6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": {
|
||||||
|
"version": "8.41.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.41.0.tgz",
|
||||||
|
"integrity": "sha512-n6m05bXn/Cd6DZDGyrpXrELCPVaTnLdPToyhBoFkLIMznRUQUEQdSp96s/pcWSQdqOhrgR1mzJ+yItK7T+WPMQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@typescript-eslint/types": "8.41.0",
|
||||||
|
"@typescript-eslint/visitor-keys": "8.41.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
@@ -2391,10 +2413,27 @@
|
|||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/tsconfig-utils": {
|
||||||
|
"version": "8.41.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.41.0.tgz",
|
||||||
|
"integrity": "sha512-TDhxYFPUYRFxFhuU5hTIJk+auzM/wKvWgoNYOPcOf6i4ReYlOoYN8q1dV5kOTjNQNJgzWN3TUUQMtlLOcUgdUw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": ">=4.8.4 <6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": {
|
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": {
|
||||||
"version": "8.39.1",
|
"version": "8.41.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.39.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.41.0.tgz",
|
||||||
"integrity": "sha512-7sPDKQQp+S11laqTrhHqeAbsCfMkwJMrV7oTDvtDds4mEofJYir414bYKUEb8YPUm9QL3U+8f6L6YExSoAGdQw==",
|
"integrity": "sha512-9EwxsWdVqh42afLbHP90n2VdHaWU/oWgbH2P0CfcNfdKL7CuKpwMQGjwev56vWu9cSKU7FWSu6r9zck6CVfnag==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -2406,16 +2445,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
|
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
|
||||||
"version": "8.39.1",
|
"version": "8.41.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.39.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.41.0.tgz",
|
||||||
"integrity": "sha512-EKkpcPuIux48dddVDXyQBlKdeTPMmALqBUbEk38McWv0qVEZwOpVJBi7ugK5qVNgeuYjGNQxrrnoM/5+TI/BPw==",
|
"integrity": "sha512-D43UwUYJmGhuwHfY7MtNKRZMmfd8+p/eNSfFe6tH5mbVDto+VQCayeAt35rOx3Cs6wxD16DQtIKw/YXxt5E0UQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/project-service": "8.39.1",
|
"@typescript-eslint/project-service": "8.41.0",
|
||||||
"@typescript-eslint/tsconfig-utils": "8.39.1",
|
"@typescript-eslint/tsconfig-utils": "8.41.0",
|
||||||
"@typescript-eslint/types": "8.39.1",
|
"@typescript-eslint/types": "8.41.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.39.1",
|
"@typescript-eslint/visitor-keys": "8.41.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"fast-glob": "^3.3.2",
|
"fast-glob": "^3.3.2",
|
||||||
"is-glob": "^4.0.3",
|
"is-glob": "^4.0.3",
|
||||||
@@ -2435,13 +2474,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": {
|
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": {
|
||||||
"version": "8.39.1",
|
"version": "8.41.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.39.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.41.0.tgz",
|
||||||
"integrity": "sha512-W8FQi6kEh2e8zVhQ0eeRnxdvIoOkAp/CPAahcNio6nO9dsIwb9b34z90KOlheoyuVf6LSOEdjlkxSkapNEc+4A==",
|
"integrity": "sha512-+GeGMebMCy0elMNg67LRNoVnUFPIm37iu5CmHESVx56/9Jsfdpsvbv605DQ81Pi/x11IdKUsS5nzgTYbCQU9fg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.39.1",
|
"@typescript-eslint/types": "8.41.0",
|
||||||
"eslint-visitor-keys": "^4.2.1"
|
"eslint-visitor-keys": "^4.2.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
"@types/react-dom": "^19.1.7",
|
"@types/react-dom": "^19.1.7",
|
||||||
"@types/semver": "^7.7.0",
|
"@types/semver": "^7.7.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
||||||
"@typescript-eslint/parser": "^8.37.0",
|
"@typescript-eslint/parser": "^8.41.0",
|
||||||
"@vitejs/plugin-react": "^4.7.0",
|
"@vitejs/plugin-react": "^4.7.0",
|
||||||
"eslint": "^9.33.0",
|
"eslint": "^9.33.0",
|
||||||
"eslint-plugin-react-hooks": "^5.2.0",
|
"eslint-plugin-react-hooks": "^5.2.0",
|
||||||
|
Reference in New Issue
Block a user