Skip to content

Commit

Permalink
Add cross-language tests with KMS AEAD with Tink prefix.
Browse files Browse the repository at this point in the history
In tink-crypto/tink-go#10 it
was mentioned that KMS Envelope Keys can and are used with a TINK prefix. And the same is probably true for KMS AEAD keys.

Add this test to make sure that all languages that currently support this are consistent. At the moment it does not work in Java.

PiperOrigin-RevId: 617204124
Change-Id: I5203daf1fdea2ac883f3269e498057f679ed0ce2
  • Loading branch information
juergw authored and copybara-github committed Mar 19, 2024
1 parent 9a4e360 commit 5149f8a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions cross_language/cross_language/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ py_test(
requirement("absl-py"),
"@tink_py//tink:tink_python",
"@tink_py//tink/aead",
"@tink_py//tink/proto:kms_aead_py_pb2",
"@tink_py//tink/proto:kms_envelope_py_pb2",
"@tink_py//tink/proto:tink_py_pb2",
"@tink_py//tink/testing:keyset_builder",
Expand Down
14 changes: 14 additions & 0 deletions cross_language/cross_language/aead_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import tink
from tink import aead

from tink.proto import kms_aead_pb2
from tink.proto import kms_envelope_pb2
from tink.proto import tink_pb2
from tink.testing import keyset_builder
Expand Down Expand Up @@ -138,6 +139,19 @@ def tearDownModule():
# TODO(b/329404375): This currently fails in Java.
['cc', 'go', 'python'],
),
'_FAKE_KMS_AEAD_WITH_TINK_PREFIX': (
tink_pb2.KeyTemplate(
value=kms_aead_pb2.KmsAeadKeyFormat(
key_uri=_FAKE_KMS_KEY_URI,
).SerializeToString(),
type_url=(
'type.googleapis.com/google.crypto.tink.KmsAeadKey'
),
output_prefix_type=tink_pb2.TINK,
),
# TODO(b/329404375): This currently fails in Java.
['cc', 'go', 'python'],
),
}


Expand Down

0 comments on commit 5149f8a

Please sign in to comment.