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
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist-packages/libupki/dist.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libupki"
version = "1.0.0-beta.4"
version = "1.0.0"
repository = "https://github.com/rustls/upki"
build-command = ["sh", "build-ffi.sh"]
cdylibs = ["upki"]
Expand Down
2 changes: 1 addition & 1 deletion dist-packages/libupki_openssl/dist.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libupki_openssl"
version = "1.0.0-beta.4"
version = "1.0.0"
repository = "https://github.com/rustls/upki"
build-command = ["sh", "build-ffi.sh"]
cdylibs = ["upki_openssl"]
Expand Down
4 changes: 2 additions & 2 deletions rustls-upki/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustls-upki"
version = "1.0.0-beta.4"
version = "1.0.0"
license.workspace = true
edition.workspace = true
description = "A rustls verifier with upki revocation integration"
Expand All @@ -10,7 +10,7 @@ rust-version.workspace = true
[dependencies]
rustls = { workspace = true, features = ["std", "tls12"] }
rustls-webpki.workspace = true
upki = { version = "=1.0.0-beta.4", path = "../upki" }
upki = { version = "1", path = "../upki" }

[dev-dependencies]
rustls = { workspace = true, features = ["aws-lc-rs"] }
Expand Down
4 changes: 2 additions & 2 deletions upki-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "upki-cli"
version = "1.0.0-beta.4"
version = "1.0.0"
rust-version.workspace = true
edition.workspace = true
repository.workspace = true
Expand All @@ -17,7 +17,7 @@ __fetch = ["upki/__fetch"]
clap.workspace = true
eyre.workspace = true
rustls-pki-types.workspace = true
upki = { version = "=1.0.0-beta.4", path = "../upki" }
upki = { version = "1", path = "../upki" }
tokio.workspace = true
toml.workspace = true
tracing.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion upki-cli/src/bin/upki.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use tracing_subscriber::EnvFilter;
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;
#[cfg(feature = "__fetch")]
use upki::revocation::fetch;
use upki::fetch;
use upki::revocation::{RevocationCheckInput, Store};
use upki::{Config, ConfigPath};

Expand Down
2 changes: 1 addition & 1 deletion upki-cli/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn version() {
success: true
exit_code: 0
----- stdout -----
upki 1.0.0-beta.4
upki 1.0.0

----- stderr -----
");
Expand Down
4 changes: 2 additions & 2 deletions upki-openssl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "upki-openssl"
version = "1.0.0-beta.4" # Sync with `dist-packages/libupki_openssl/dist.toml`
version = "1.0.0" # Sync with `dist-packages/libupki_openssl/dist.toml`
license.workspace = true
rust-version.workspace = true
edition.workspace = true
Expand All @@ -12,7 +12,7 @@ capi = []
[dependencies]
openssl-sys = { workspace = true }
rustls-pki-types.workspace = true
upki = { version = "=1.0.0-beta.4", path = "../upki", features = ["capi"] }
upki = { version = "1", path = "../upki", features = ["capi"] }

[dev-dependencies]
cbindgen.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion upki/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "upki"
version = "1.0.0-beta.4" # Sync with `dist-packages/libupki/dist.toml`
version = "1.0.0" # Sync with `dist-packages/libupki/dist.toml`
rust-version.workspace = true
edition.workspace = true
repository.workspace = true
Expand Down
75 changes: 13 additions & 62 deletions upki/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,46 +175,32 @@ pub enum upki_result {
UPKI_ERR_NO_HOME_DIR = 36,

// Errors from upki::revocation::Error
/// Failed to create a directory.
UPKI_ERR_REVOCATION_CREATE_DIR = 64,
/// Failed to write a file.
UPKI_ERR_REVOCATION_FILE_WRITE = 65,
/// Failed to decode a file.
UPKI_ERR_REVOCATION_FILE_DECODE = 66,
UPKI_ERR_REVOCATION_FILE_DECODE = 64,
/// Failed to read a file.
UPKI_ERR_REVOCATION_FILE_READ = 67,
/// A downloaded file did not match the expected hash.
UPKI_ERR_REVOCATION_HASH_MISMATCH = 68,
/// Failed to fetch a file over HTTP.
UPKI_ERR_REVOCATION_HTTP_FETCH = 69,
UPKI_ERR_REVOCATION_FILE_READ = 65,
/// Invalid base64 encoding.
UPKI_ERR_REVOCATION_INVALID_BASE64 = 70,
UPKI_ERR_REVOCATION_INVALID_BASE64 = 66,
/// The end-entity certificate was invalid.
UPKI_ERR_REVOCATION_INVALID_END_ENTITY_CERT = 71,
UPKI_ERR_REVOCATION_INVALID_END_ENTITY_CERT = 67,
/// An intermediate certificate was invalid.
UPKI_ERR_REVOCATION_INVALID_INTERMEDIATE_CERT = 72,
UPKI_ERR_REVOCATION_INVALID_INTERMEDIATE_CERT = 68,
/// A base64-decoded value did not have the expected length.
UPKI_ERR_REVOCATION_INVALID_LENGTH = 73,
UPKI_ERR_REVOCATION_INVALID_LENGTH = 69,
/// Invalid SCT encoding.
UPKI_ERR_REVOCATION_INVALID_SCT_ENCODING = 74,
UPKI_ERR_REVOCATION_INVALID_SCT_ENCODING = 70,
/// An SCT in the end-entity certificate could not be parsed.
UPKI_ERR_REVOCATION_INVALID_SCT_IN_CERT = 75,
UPKI_ERR_REVOCATION_INVALID_SCT_IN_CERT = 71,
/// A timestamp could not be parsed.
UPKI_ERR_REVOCATION_INVALID_TIMESTAMP = 76,
/// Failed to encode a manifest file.
UPKI_ERR_REVOCATION_MANIFEST_ENCODE = 77,
UPKI_ERR_REVOCATION_INVALID_TIMESTAMP = 72,
/// No issuer found for the end-entity certificate.
UPKI_ERR_REVOCATION_NO_ISSUER = 78,
/// Cache is outdated.
UPKI_ERR_REVOCATION_OUTDATED = 79,
/// Failed to remove a file.
UPKI_ERR_REVOCATION_REMOVE_FILE = 80,
UPKI_ERR_REVOCATION_NO_ISSUER = 73,
/// Certificate chain must contain at least 2 certificates.
UPKI_ERR_REVOCATION_TOO_FEW_CERTS = 81,
UPKI_ERR_REVOCATION_TOO_FEW_CERTS = 74,
/// Failed to decode the index file.
UPKI_ERR_REVOCATION_INDEX_DECODE = 82,
UPKI_ERR_REVOCATION_INDEX_DECODE = 75,
/// No revocation data is present in the cache.
UPKI_ERR_REVOCATION_NO_DATA = 83,
UPKI_ERR_REVOCATION_NO_DATA = 76,
}

impl upki_result {
Expand All @@ -238,14 +224,8 @@ impl upki_result {
Self::UPKI_ERR_NO_CACHE_DIR => c"no cache directory could be found",
Self::UPKI_ERR_NO_CONFIG_DIR => c"no configuration directory could be found",
Self::UPKI_ERR_NO_HOME_DIR => c"the user's home directory could not be determined",
Self::UPKI_ERR_REVOCATION_CREATE_DIR => c"failed to create a directory",
Self::UPKI_ERR_REVOCATION_FILE_WRITE => c"failed to write a file",
Self::UPKI_ERR_REVOCATION_FILE_DECODE => c"failed to decode a file",
Self::UPKI_ERR_REVOCATION_FILE_READ => c"failed to read a file",
Self::UPKI_ERR_REVOCATION_HASH_MISMATCH => {
c"a downloaded file did not match the expected hash"
}
Self::UPKI_ERR_REVOCATION_HTTP_FETCH => c"failed to fetch a file over http",
Self::UPKI_ERR_REVOCATION_INVALID_BASE64 => c"invalid base64 encoding",
Self::UPKI_ERR_REVOCATION_INVALID_END_ENTITY_CERT => {
c"the end-entity certificate was invalid"
Expand All @@ -261,12 +241,9 @@ impl upki_result {
c"an sct in the end-entity certificate could not be parsed"
}
Self::UPKI_ERR_REVOCATION_INVALID_TIMESTAMP => c"a timestamp could not be parsed",
Self::UPKI_ERR_REVOCATION_MANIFEST_ENCODE => c"failed to encode a manifest file",
Self::UPKI_ERR_REVOCATION_NO_ISSUER => {
c"no issuer found for the end-entity certificate"
}
Self::UPKI_ERR_REVOCATION_OUTDATED => c"cache is outdated",
Self::UPKI_ERR_REVOCATION_REMOVE_FILE => c"failed to remove a file",
Self::UPKI_ERR_REVOCATION_TOO_FEW_CERTS => {
c"certificate chain must contain at least 2 certificates"
}
Expand All @@ -290,23 +267,16 @@ impl upki_result {
Self::UPKI_ERR_NO_CACHE_DIR,
Self::UPKI_ERR_NO_CONFIG_DIR,
Self::UPKI_ERR_NO_HOME_DIR,
Self::UPKI_ERR_REVOCATION_CREATE_DIR,
Self::UPKI_ERR_REVOCATION_FILE_WRITE,
Self::UPKI_ERR_REVOCATION_FILE_DECODE,
Self::UPKI_ERR_REVOCATION_FILE_READ,
Self::UPKI_ERR_REVOCATION_HASH_MISMATCH,
Self::UPKI_ERR_REVOCATION_HTTP_FETCH,
Self::UPKI_ERR_REVOCATION_INVALID_BASE64,
Self::UPKI_ERR_REVOCATION_INVALID_END_ENTITY_CERT,
Self::UPKI_ERR_REVOCATION_INVALID_INTERMEDIATE_CERT,
Self::UPKI_ERR_REVOCATION_INVALID_LENGTH,
Self::UPKI_ERR_REVOCATION_INVALID_SCT_ENCODING,
Self::UPKI_ERR_REVOCATION_INVALID_SCT_IN_CERT,
Self::UPKI_ERR_REVOCATION_INVALID_TIMESTAMP,
Self::UPKI_ERR_REVOCATION_MANIFEST_ENCODE,
Self::UPKI_ERR_REVOCATION_NO_ISSUER,
Self::UPKI_ERR_REVOCATION_OUTDATED,
Self::UPKI_ERR_REVOCATION_REMOVE_FILE,
Self::UPKI_ERR_REVOCATION_TOO_FEW_CERTS,
Self::UPKI_ERR_REVOCATION_INDEX_DECODE,
Self::UPKI_ERR_REVOCATION_NO_DATA,
Expand All @@ -321,24 +291,12 @@ impl From<Error> for upki_result {
Error::NoCacheDirectoryFound => Self::UPKI_ERR_NO_CACHE_DIR,
Error::NoConfigDirectoryFound => Self::UPKI_ERR_NO_CONFIG_DIR,
Error::NoValidHomeDirectory => Self::UPKI_ERR_NO_HOME_DIR,
Error::Revocation(revocation::Error::CreateDirectory { .. }) => {
Self::UPKI_ERR_REVOCATION_CREATE_DIR
}
Error::Revocation(revocation::Error::FileWrite { .. }) => {
Self::UPKI_ERR_REVOCATION_FILE_WRITE
}
Error::Revocation(revocation::Error::FileDecode { .. }) => {
Self::UPKI_ERR_REVOCATION_FILE_DECODE
}
Error::Revocation(revocation::Error::FileRead { .. }) => {
Self::UPKI_ERR_REVOCATION_FILE_READ
}
Error::Revocation(revocation::Error::HashMismatch(_)) => {
Self::UPKI_ERR_REVOCATION_HASH_MISMATCH
}
Error::Revocation(revocation::Error::HttpFetch { .. }) => {
Self::UPKI_ERR_REVOCATION_HTTP_FETCH
}
Error::Revocation(revocation::Error::InvalidBase64 { .. }) => {
Self::UPKI_ERR_REVOCATION_INVALID_BASE64
}
Expand All @@ -360,14 +318,7 @@ impl From<Error> for upki_result {
Error::Revocation(revocation::Error::InvalidTimestamp { .. }) => {
Self::UPKI_ERR_REVOCATION_INVALID_TIMESTAMP
}
Error::Revocation(revocation::Error::ManifestEncode { .. }) => {
Self::UPKI_ERR_REVOCATION_MANIFEST_ENCODE
}
Error::Revocation(revocation::Error::NoIssuer) => Self::UPKI_ERR_REVOCATION_NO_ISSUER,
Error::Revocation(revocation::Error::Outdated(_)) => Self::UPKI_ERR_REVOCATION_OUTDATED,
Error::Revocation(revocation::Error::RemoveFile { .. }) => {
Self::UPKI_ERR_REVOCATION_REMOVE_FILE
}
Error::Revocation(revocation::Error::TooFewCertificates) => {
Self::UPKI_ERR_REVOCATION_TOO_FEW_CERTS
}
Expand Down
Loading
Loading