aboutsummaryrefslogtreecommitdiffstats
path: root/security-utils/src/main/java/com/yahoo/security/hpke
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2023-01-30 14:41:01 +0100
committerTor Brede Vekterli <vekterli@yahooinc.com>2023-01-31 17:20:36 +0100
commit5ffdfd6d0bc77eda829054c9c3de6fba950507de (patch)
treeddbb173a6300fce2a7c3cf1ee70878d252f4a947 /security-utils/src/main/java/com/yahoo/security/hpke
parent3e54969fc961ee51c93404a37d559ab7ea2f9fe6 (diff)
Add an "interactive" token resealing protocol and basic tooling support
Implements a protocol for delegated access to a shared secret key of a token whose private key we do not possess. This builds directly on top of the existing token resealing mechanisms. The primary benefit of the resealing protocol is that none of the data exchanged can reveal anything about the underlying secret. Security note: neither resealing requests nor responses are explicitly authenticated (this is a property inherited from the sealed shared key tokens themselves). It is assumed that an attacker can observe all requests and responses in transit, but cannot modify them.
Diffstat (limited to 'security-utils/src/main/java/com/yahoo/security/hpke')
-rw-r--r--security-utils/src/main/java/com/yahoo/security/hpke/Hpke.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/security-utils/src/main/java/com/yahoo/security/hpke/Hpke.java b/security-utils/src/main/java/com/yahoo/security/hpke/Hpke.java
index 133798faa99..51f41ab7da7 100644
--- a/security-utils/src/main/java/com/yahoo/security/hpke/Hpke.java
+++ b/security-utils/src/main/java/com/yahoo/security/hpke/Hpke.java
@@ -175,7 +175,7 @@ public final class Hpke {
}
}
- private static record ContextBase(byte[] key, byte[] nonce, long seqNum, byte[] exporterSecret) { }
+ private record ContextBase(byte[] key, byte[] nonce, long seqNum, byte[] exporterSecret) { }
/**
* Section 5.1 Creating the Encryption Context:
@@ -219,8 +219,8 @@ public final class Hpke {
return new ContextBase(key, baseNonce, 0, exporterSecret);
}
- private static record ContextS(byte[] enc, ContextBase base) {}
- private static record ContextR(ContextBase base) {}
+ private record ContextS(byte[] enc, ContextBase base) {}
+ private record ContextR(ContextBase base) {}
/**
* Section 5.1.1 Encryption to a Public Key:
@@ -253,7 +253,7 @@ public final class Hpke {
return new ContextR(keySchedule(MODE_BASE, sharedSecret, info, DEFAULT_PSK, DEFAULT_PSK_ID));
}
- public static record Sealed(byte[] enc, byte[] ciphertext) {}
+ public record Sealed(byte[] enc, byte[] ciphertext) {}
/**
* Section 6.1 Encryption and Decryption: