summaryrefslogtreecommitdiffstats
path: root/vendor/pasetors
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/pasetors
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/pasetors')
-rw-r--r--vendor/pasetors/.cargo-checksum.json2
-rw-r--r--vendor/pasetors/CHANGELOG.md9
-rw-r--r--vendor/pasetors/Cargo.toml2
-rw-r--r--vendor/pasetors/SECURITY.md13
-rw-r--r--vendor/pasetors/src/claims.rs45
-rw-r--r--vendor/pasetors/src/lib.rs2
6 files changed, 70 insertions, 3 deletions
diff --git a/vendor/pasetors/.cargo-checksum.json b/vendor/pasetors/.cargo-checksum.json
index 731ccf01c..1965dce8f 100644
--- a/vendor/pasetors/.cargo-checksum.json
+++ b/vendor/pasetors/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"CHANGELOG.md":"8c750fc92f0e9dc0d9d05016e9c90d3f82e9c7aa0eb3791b6d166314242dbe15","Cargo.toml":"14462eb8753564324380e2bb54aa996c2da7d992462d0ddc201b7ccdabd1928f","LICENSE":"c8dba4239d56fb2d257aee9e4bdb99fea001ea6e3a99f6775fbd2c710956df36","README.md":"39d33e04b62401e17a471a9251ee84aa476efb01bdc509b8e42dc6dfe6aaf88a","src/claims.rs":"2086f5f55bd89a48bddf8aa35ccc9818a4411e79903787cb7f473a620fdcc4e8","src/common.rs":"1fcf08b5f0a035559484f152b6d7f9be5c69976a6d9107ecf26e4b68719fc1e9","src/errors.rs":"8e2c5f5e85d726ac0e664d09c0b5117dd8e40b940d2f4b2fff5112f277129b81","src/footer.rs":"32d0a8db1f62c11ee78363c9b175215c8b2c33c761ab7832e3c10d12473a945d","src/keys.rs":"3e0f249a2de6909d35bdc88dbe1e0bd591e552a10f19b36d8f2cedd633da1671","src/lib.rs":"9f04a229a38bcd9c5767a7889356f0583e7a97702707d836ae3988b52f4a6123","src/pae.rs":"cecb8dafbdf331b6b32e60d1fc5f666a6cc614947188695f1854e00bb84b1f01","src/paserk.rs":"8fab1ac06a4bb5666e651fc3794f9a59ea76c6aa5c4f710a57a01d1fa381438a","src/serde.rs":"3359a60a1fd46ea9140ee7adcf6f92a48fbdda80e87a33f9144864878a71a7ee","src/token.rs":"2b2016664cd0e4e3164ab5dd4bc009c36fd9a750090dc78b407119f4cf33dc2d","src/version.rs":"d340261226d6592ac48f3648a8242dc61d7e7a8e7a59f4a4d87de2d87b74d05e","src/version2.rs":"87b84cb64e66ee83bd4ca0439faadd9bfefc47f34bf178e4d887cadb6ffacdf6","src/version3.rs":"104f123b3cf410604045d0bc2451efe05b90072bfa9eb1feb5095f1949ea208f","src/version4.rs":"c28ebd71acc681ef7b16912d579bff768b38068a83e5912a0c0f63aeea3d5e99","test_vectors/PASERK/k2.lid.json":"c5f5b1bf3449ab9c58abf983270578027d03f41bce00cd8c49d4086745aeca7e","test_vectors/PASERK/k2.local.json":"335f3f1aa056f98ceb7ea691e26f3837ae33d566006d35530cfdc4940b676cdc","test_vectors/PASERK/k2.pid.json":"2b700fa931d3d6e9f0cb693d6d64bec0fb2a290f7059b78ea6eabff14aadadb8","test_vectors/PASERK/k2.public.json":"5fc4c039258046936a3b26dca2d8581a5831a7279186f6a629114ff2c70b1354","test_vectors/PASERK/k2.secret.json":"fda27580d0dc2931033bf9e3660b2d37cc3d6f1272f966dfdfb88e936cd7f660","test_vectors/PASERK/k2.sid.json":"aea692b0bfcc971eacc437869160b0988b21a5138c4109544acef0d6c8150df2","test_vectors/PASERK/k3.pid.json":"d257888dfe3aa5803bb71e3a2886bbf2761de9f7cff0737c553d8639eac0ff3b","test_vectors/PASERK/k3.public.json":"a5d1e05238fead0afa860b5037c973ad9e3a62ab26fb8675889393442d18cd35","test_vectors/PASERK/k3.secret.json":"d7c37094f0365c6afe6bba3ea28c164c21c54c769bf925ab2fac7c9ed5c1ae65","test_vectors/PASERK/k3.sid.json":"f77a2a8b97cf787579a82581b4be167d8d1906ab3c1e4ea16a299c2a8d2dc10a","test_vectors/PASERK/k4.lid.json":"893dc77e6b2a82a6e98ed683293a541fae50fd5447713ce89a2e9c7efd54529b","test_vectors/PASERK/k4.local.json":"71c76cafab9cbeb5223425105f08900b245048a9a2a7d573b9a3f1f3d4633ebc","test_vectors/PASERK/k4.pid.json":"b5735e8734e17afe2da884b7ce76aa79e2d34b6be27834c7f1d6b7c1304d911d","test_vectors/PASERK/k4.public.json":"f8d86e8b05baf2bd67fcf77f1451fe49fb6232ce1358032f8fa5070d8e3bcc55","test_vectors/PASERK/k4.secret.json":"87a2e6880df94c80f5a645f24c4c9100b12b678a236fb80c2232d62d4cbcc22c","test_vectors/PASERK/k4.sid.json":"ca500b86c33fad8145466379c4e0ba727d92803abd27fe97b7ea6886459792f0","test_vectors/v2.json":"b58b11047f26596acdbcad7cfd4e270bc3e917f86e2be85b22f0d6be06ae79d0","test_vectors/v3.json":"79cfd384762a6df3c6ce08ff04d9fb24f128943c2e38e3333f3e440a8546d8a4","test_vectors/v4.json":"0b72948b65d1f73f574c9ad2aa3481ec27bf8c632f5f6e1596cd41f5b9703387","test_vectors/wycheproof/ecdsa_secp384r1_sha384_test.json":"40f75fd0ae931c110cf5a4a4977e6cea40e4877f922289ac8685fa6c4b70c572","test_vectors/wycheproof/ecdsa_secp384r1_sha3_384_test.json":"5b00927809ac9809c9b58a51771a53d4ce06327f5269b6e08912244958a3ec06"},"package":"824bf633b85dc1dece2eb07161627ba5d90a951597cd5dbf8d85f4d82b7aea69"} \ No newline at end of file
+{"files":{"CHANGELOG.md":"7d988a6aaba1dd32d6cd18b5d0e611fb3a966a98dc3e61eb1aded64763032c00","Cargo.toml":"37be8ca79af658a1dd503a475d3baca7200f23b19b7c39eb353b9e7962853ec8","LICENSE":"c8dba4239d56fb2d257aee9e4bdb99fea001ea6e3a99f6775fbd2c710956df36","README.md":"39d33e04b62401e17a471a9251ee84aa476efb01bdc509b8e42dc6dfe6aaf88a","SECURITY.md":"4fc949365d84003ea1beef213a0cc08cad204ed3b4a5e6eb3a23db21b8c89b17","src/claims.rs":"19145c19b1c7264d9ae9e1016ad661da4963662c4d17e4c23be8cfa71ee9dabd","src/common.rs":"1fcf08b5f0a035559484f152b6d7f9be5c69976a6d9107ecf26e4b68719fc1e9","src/errors.rs":"8e2c5f5e85d726ac0e664d09c0b5117dd8e40b940d2f4b2fff5112f277129b81","src/footer.rs":"32d0a8db1f62c11ee78363c9b175215c8b2c33c761ab7832e3c10d12473a945d","src/keys.rs":"3e0f249a2de6909d35bdc88dbe1e0bd591e552a10f19b36d8f2cedd633da1671","src/lib.rs":"3bb24991ab195d8084d066c60dd5422099f7850b7971cfd79f1741a9c925d8f8","src/pae.rs":"cecb8dafbdf331b6b32e60d1fc5f666a6cc614947188695f1854e00bb84b1f01","src/paserk.rs":"8fab1ac06a4bb5666e651fc3794f9a59ea76c6aa5c4f710a57a01d1fa381438a","src/serde.rs":"3359a60a1fd46ea9140ee7adcf6f92a48fbdda80e87a33f9144864878a71a7ee","src/token.rs":"2b2016664cd0e4e3164ab5dd4bc009c36fd9a750090dc78b407119f4cf33dc2d","src/version.rs":"d340261226d6592ac48f3648a8242dc61d7e7a8e7a59f4a4d87de2d87b74d05e","src/version2.rs":"87b84cb64e66ee83bd4ca0439faadd9bfefc47f34bf178e4d887cadb6ffacdf6","src/version3.rs":"104f123b3cf410604045d0bc2451efe05b90072bfa9eb1feb5095f1949ea208f","src/version4.rs":"c28ebd71acc681ef7b16912d579bff768b38068a83e5912a0c0f63aeea3d5e99","test_vectors/PASERK/k2.lid.json":"c5f5b1bf3449ab9c58abf983270578027d03f41bce00cd8c49d4086745aeca7e","test_vectors/PASERK/k2.local.json":"335f3f1aa056f98ceb7ea691e26f3837ae33d566006d35530cfdc4940b676cdc","test_vectors/PASERK/k2.pid.json":"2b700fa931d3d6e9f0cb693d6d64bec0fb2a290f7059b78ea6eabff14aadadb8","test_vectors/PASERK/k2.public.json":"5fc4c039258046936a3b26dca2d8581a5831a7279186f6a629114ff2c70b1354","test_vectors/PASERK/k2.secret.json":"fda27580d0dc2931033bf9e3660b2d37cc3d6f1272f966dfdfb88e936cd7f660","test_vectors/PASERK/k2.sid.json":"aea692b0bfcc971eacc437869160b0988b21a5138c4109544acef0d6c8150df2","test_vectors/PASERK/k3.pid.json":"d257888dfe3aa5803bb71e3a2886bbf2761de9f7cff0737c553d8639eac0ff3b","test_vectors/PASERK/k3.public.json":"a5d1e05238fead0afa860b5037c973ad9e3a62ab26fb8675889393442d18cd35","test_vectors/PASERK/k3.secret.json":"d7c37094f0365c6afe6bba3ea28c164c21c54c769bf925ab2fac7c9ed5c1ae65","test_vectors/PASERK/k3.sid.json":"f77a2a8b97cf787579a82581b4be167d8d1906ab3c1e4ea16a299c2a8d2dc10a","test_vectors/PASERK/k4.lid.json":"893dc77e6b2a82a6e98ed683293a541fae50fd5447713ce89a2e9c7efd54529b","test_vectors/PASERK/k4.local.json":"71c76cafab9cbeb5223425105f08900b245048a9a2a7d573b9a3f1f3d4633ebc","test_vectors/PASERK/k4.pid.json":"b5735e8734e17afe2da884b7ce76aa79e2d34b6be27834c7f1d6b7c1304d911d","test_vectors/PASERK/k4.public.json":"f8d86e8b05baf2bd67fcf77f1451fe49fb6232ce1358032f8fa5070d8e3bcc55","test_vectors/PASERK/k4.secret.json":"87a2e6880df94c80f5a645f24c4c9100b12b678a236fb80c2232d62d4cbcc22c","test_vectors/PASERK/k4.sid.json":"ca500b86c33fad8145466379c4e0ba727d92803abd27fe97b7ea6886459792f0","test_vectors/v2.json":"b58b11047f26596acdbcad7cfd4e270bc3e917f86e2be85b22f0d6be06ae79d0","test_vectors/v3.json":"79cfd384762a6df3c6ce08ff04d9fb24f128943c2e38e3333f3e440a8546d8a4","test_vectors/v4.json":"0b72948b65d1f73f574c9ad2aa3481ec27bf8c632f5f6e1596cd41f5b9703387","test_vectors/wycheproof/ecdsa_secp384r1_sha384_test.json":"40f75fd0ae931c110cf5a4a4977e6cea40e4877f922289ac8685fa6c4b70c572","test_vectors/wycheproof/ecdsa_secp384r1_sha3_384_test.json":"5b00927809ac9809c9b58a51771a53d4ce06327f5269b6e08912244958a3ec06"},"package":"ba765699a309908d55950919a3445e9491453e89b2587b1b2abe4143a48894c0"} \ No newline at end of file
diff --git a/vendor/pasetors/CHANGELOG.md b/vendor/pasetors/CHANGELOG.md
index ca9be2363..c1c91a670 100644
--- a/vendor/pasetors/CHANGELOG.md
+++ b/vendor/pasetors/CHANGELOG.md
@@ -1,3 +1,12 @@
+### 0.6.7
+
+__Date:__ June 10, 2023.
+
+__Changelog:__
+- Add security policy.
+- Add `Claims::new_expires_in()` ([#96](https://github.com/brycx/pasetors/issues/96)).
+
+
### 0.6.6
__Date:__ March 4, 2023.
diff --git a/vendor/pasetors/Cargo.toml b/vendor/pasetors/Cargo.toml
index f90220917..8d9c871f0 100644
--- a/vendor/pasetors/Cargo.toml
+++ b/vendor/pasetors/Cargo.toml
@@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.65.0"
name = "pasetors"
-version = "0.6.6"
+version = "0.6.7"
authors = ["brycx <brycx@protonmail.com>"]
description = "PASETO: Platform-Agnostic Security Tokens (in Rust)"
documentation = "https://docs.rs/pasetors"
diff --git a/vendor/pasetors/SECURITY.md b/vendor/pasetors/SECURITY.md
new file mode 100644
index 000000000..efa36920e
--- /dev/null
+++ b/vendor/pasetors/SECURITY.md
@@ -0,0 +1,13 @@
+# Security Policy
+
+## Supported Versions
+
+Only the latest version released on crates.io is supported. Versions older than that are not supported.
+
+## Reporting a Vulnerability
+
+All feedback from security researchers is greatly appreciated! If you discover a vulnerability, you can use GitHub's private vulnerability reporting feature, to [report a new vulnerability](https://github.com/brycx/pasetors/security/advisories/new).
+
+We aim to fix vulnerabilities within a 90-day window.
+
+Thank you for your efforts in helping identify and fix vulnerabilities in `pasetors`!
diff --git a/vendor/pasetors/src/claims.rs b/vendor/pasetors/src/claims.rs
index b6d97580a..10f20b618 100644
--- a/vendor/pasetors/src/claims.rs
+++ b/vendor/pasetors/src/claims.rs
@@ -1,6 +1,7 @@
#![cfg_attr(docsrs, doc(cfg(feature = "std")))]
use crate::errors::Error;
+use core::convert::TryFrom;
use serde_json::Value;
use std::collections::HashMap;
use time::format_description::well_known::Rfc3339;
@@ -40,6 +41,30 @@ impl Claims {
Ok(claims)
}
+ /// Create a new `Claims` instance expiring in `duration`, setting:
+ /// - `iat`, `nbf` to current UTC time
+ /// - `iat + duration`
+ ///
+ /// Errors:
+ /// - If adding current time with `duration` would overflow
+ /// - If `core::time::Duration` failed to convert to `time::Duration`
+ pub fn new_expires_in(duration: &core::time::Duration) -> Result<Self, Error> {
+ let iat = OffsetDateTime::now_utc();
+ let nbf = iat;
+ let mut exp = iat;
+ exp += Duration::try_from(*duration).map_err(|_| Error::InvalidClaim)?;
+
+ let mut claims = Self {
+ list_of: HashMap::new(),
+ };
+
+ claims.issued_at(&iat.format(&Rfc3339).map_err(|_| Error::InvalidClaim)?)?;
+ claims.not_before(&nbf.format(&Rfc3339).map_err(|_| Error::InvalidClaim)?)?;
+ claims.expiration(&exp.format(&Rfc3339).map_err(|_| Error::InvalidClaim)?)?;
+
+ Ok(claims)
+ }
+
/// Removes the `exp` claim, indicating a token that never expires.
pub fn non_expiring(&mut self) {
if self.contains_claim("exp") {
@@ -731,4 +756,24 @@ mod test {
claims.list_of.remove("exp");
assert!(claims_validation.validate_claims(&claims).is_err());
}
+
+ #[test]
+ fn test_custom_expiration_duration() {
+ // Duration of 3 hours instead of 1.
+ let duration = core::time::Duration::new(10800, 0);
+ let mut claims = Claims::new_expires_in(&duration).unwrap();
+
+ let claims_validation = ClaimsValidationRules::new();
+ assert!(claims_validation.validate_claims(&claims).is_ok());
+
+ claims
+ .list_of
+ .insert("exp".to_string(), "2019-01-01T00:00:00+00:00".into())
+ .unwrap();
+ // Expired
+ assert_eq!(
+ claims_validation.validate_claims(&claims).unwrap_err(),
+ Error::ClaimValidation
+ );
+ }
}
diff --git a/vendor/pasetors/src/lib.rs b/vendor/pasetors/src/lib.rs
index 6b58b8378..eb29a7166 100644
--- a/vendor/pasetors/src/lib.rs
+++ b/vendor/pasetors/src/lib.rs
@@ -183,7 +183,7 @@
unused_qualifications,
overflowing_literals
)]
-#![doc(html_root_url = "https://docs.rs/pasetors/0.6.6")]
+#![doc(html_root_url = "https://docs.rs/pasetors/0.6.7")]
#![cfg_attr(docsrs, feature(doc_cfg))]
#[macro_use]