P getPrimitive(Class
classObject) throws GeneralSecurityException * registry to get resources creating the primitive. The given keyManager will take precedence * when creating primitives over the globally registered keyManagers. */ + @Alpha public
P getPrimitive(KeyManager
customKeyManager, Class
classObject) throws GeneralSecurityException { if (customKeyManager == null) { diff --git a/java/src/main/java/com/google/crypto/tink/subtle/XChaCha20.java b/java/src/main/java/com/google/crypto/tink/subtle/XChaCha20.java index 0ac59a561f..8c9aefe5a9 100644 --- a/java/src/main/java/com/google/crypto/tink/subtle/XChaCha20.java +++ b/java/src/main/java/com/google/crypto/tink/subtle/XChaCha20.java @@ -16,6 +16,7 @@ package com.google.crypto.tink.subtle; +import com.google.crypto.tink.annotations.Alpha; import java.security.InvalidKeyException; import java.util.Arrays; @@ -26,6 +27,7 @@ * *
This cipher is meant to be used to construct an AEAD with Poly1305. */ +@Alpha class XChaCha20 extends ChaCha20Base { /** * Constructs a new XChaCha20 cipher with the supplied {@code key}. diff --git a/java/src/main/java/com/google/crypto/tink/subtle/XChaCha20Poly1305.java b/java/src/main/java/com/google/crypto/tink/subtle/XChaCha20Poly1305.java index f8a4864e34..ccfd5ff91e 100644 --- a/java/src/main/java/com/google/crypto/tink/subtle/XChaCha20Poly1305.java +++ b/java/src/main/java/com/google/crypto/tink/subtle/XChaCha20Poly1305.java @@ -16,12 +16,14 @@ package com.google.crypto.tink.subtle; +import com.google.crypto.tink.annotations.Alpha; import java.security.InvalidKeyException; /** * XChaCha20Poly1305 AEAD construction, as described in * https://tools.ietf.org/html/draft-arciszewski-xchacha-01. */ +@Alpha public final class XChaCha20Poly1305 extends ChaCha20Poly1305Base { public XChaCha20Poly1305(final byte[] key) throws InvalidKeyException { super(key); diff --git a/kokoro/run_tests.sh b/kokoro/run_tests.sh index 1f100fb9b8..6517072edd 100755 --- a/kokoro/run_tests.sh +++ b/kokoro/run_tests.sh @@ -34,7 +34,7 @@ if [[ -z "${TMP}" ]]; then exit 4 fi -readonly PLATFORM="$(uname | tr '[:upper:]' '[:lower:]')" +PLATFORM=`uname | tr '[:upper:]' '[:lower:]'` declare -a DISABLE_SANDBOX_ARGS DISABLE_SANDBOX_ARGS=( @@ -48,20 +48,14 @@ DISABLE_SANDBOX_ARGS=( ) readonly DISABLE_SANDBOX_ARGS -# Only in Kokoro environments. -if [[ -n "${KOKORO_ROOT}" ]]; then - # TODO(b/73748835): Workaround on Kokoro. +# Workaround b/73748835#comment5 on Kokoro. +if ! [ -z "${KOKORO_ROOT}" ]; then rm -f ~/.bazelrc - # Install the latest version of Bazel. use_bazel.sh latest - - if [[ "${PLATFORM}" == 'darwin' ]]; then + if [[ "$PLATFORM" == 'darwin' ]]; then export DEVELOPER_DIR="/Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer" export ANDROID_HOME="/Users/kbuilder/Library/Android/sdk" - - # TODO(b/120214184): Workaround for broken macos_external time sync. - sudo ntpdate -u time.apple.com fi fi diff --git a/objc/TINKKeysetHandle+Cleartext.h b/objc/TINKKeysetHandle+Cleartext.h index 84e91a2073..053859ad8e 100644 --- a/objc/TINKKeysetHandle+Cleartext.h +++ b/objc/TINKKeysetHandle+Cleartext.h @@ -40,11 +40,6 @@ NS_ASSUME_NONNULL_BEGIN - (nullable instancetype)initCleartextKeysetHandleWithKeysetReader:(TINKKeysetReader *)reader error:(NSError **)error; -/** - * Returns the serialized Keyset-proto for this TINKKeysetHandle. - */ -- (NSData *)serializedKeyset; - @end NS_ASSUME_NONNULL_END diff --git a/objc/Tests/UnitTests/core/TINKCleartextKeysetHandleTest.mm b/objc/Tests/UnitTests/core/TINKCleartextKeysetHandleTest.mm index 9d746f6cac..f724b0d8b1 100644 --- a/objc/Tests/UnitTests/core/TINKCleartextKeysetHandleTest.mm +++ b/objc/Tests/UnitTests/core/TINKCleartextKeysetHandleTest.mm @@ -87,32 +87,4 @@ - (void)testReadInvalidKeyset { XCTAssertTrue(error.code == crypto::tink::util::error::INVALID_ARGUMENT); } -- (void)testSerializeKeyset { - google::crypto::tink::Keyset keyset; - google::crypto::tink::Keyset::Key key; - crypto::tink::test::AddTinkKey("some key type", 42, key, - google::crypto::tink::KeyStatusType::ENABLED, - google::crypto::tink::KeyData::SYMMETRIC, &keyset); - crypto::tink::test::AddRawKey("some other key type", 711, key, - google::crypto::tink::KeyStatusType::ENABLED, - google::crypto::tink::KeyData::SYMMETRIC, &keyset); - keyset.set_primary_key_id(42); - - NSData *serializedKeyset = TINKStringToNSData(keyset.SerializeAsString()); - - NSError *error = nil; - TINKBinaryKeysetReader *reader = - [[TINKBinaryKeysetReader alloc] initWithSerializedKeyset:serializedKeyset error:&error]; - - XCTAssertNil(error); - XCTAssertNotNil(reader); - - TINKKeysetHandle *handle = - [[TINKKeysetHandle alloc] initCleartextKeysetHandleWithKeysetReader:reader error:&error]; - - XCTAssertNotNil(handle); - XCTAssertTrue([serializedKeyset isEqualToData:handle.serializedKeyset]); -} - - @end diff --git a/objc/core/TINKKeysetHandle+Cleartext.mm b/objc/core/TINKKeysetHandle+Cleartext.mm index c740e78d24..0adde45b73 100644 --- a/objc/core/TINKKeysetHandle+Cleartext.mm +++ b/objc/core/TINKKeysetHandle+Cleartext.mm @@ -24,7 +24,6 @@ #import "objc/core/TINKKeysetHandle_Internal.h" #import "objc/core/TINKKeysetReader_Internal.h" #import "objc/util/TINKErrors.h" -#import "objc/util/TINKStrings.h" @implementation TINKKeysetHandle (Cleartext) @@ -53,9 +52,4 @@ - (nullable instancetype)initCleartextKeysetHandleWithKeysetReader:(TINKKeysetRe return [[TINKKeysetHandle alloc] initWithCCKeysetHandle:std::move(st.ValueOrDie())]; } -- (NSData *)serializedKeyset { - auto keyset = crypto::tink::CleartextKeysetHandle::GetKeyset(*self.ccKeysetHandle); - return TINKStringToNSData(keyset.SerializeAsString()); -} - @end diff --git a/third_party/rules_protobuf/protobuf/rules.bzl b/third_party/rules_protobuf/protobuf/rules.bzl index ecaaf192b5..80f6f72e70 100644 --- a/third_party/rules_protobuf/protobuf/rules.bzl +++ b/third_party/rules_protobuf/protobuf/rules.bzl @@ -2,16 +2,5 @@ """ -load( - "//third_party/rules_protobuf/protobuf:internal/proto_compile.bzl", - _proto_compile = "proto_compile", -) -load( - "//third_party/rules_protobuf/protobuf:internal/proto_language.bzl", - _proto_language = "proto_language", - _proto_language_deps = "proto_language_deps", -) - -proto_compile = _proto_compile -proto_language = _proto_language -proto_language_deps = _proto_language_deps +load("//third_party/rules_protobuf/protobuf:internal/proto_compile.bzl", "proto_compile") +load("//third_party/rules_protobuf/protobuf:internal/proto_language.bzl", "proto_language", "proto_language_deps") diff --git a/tools/testing/cc/BUILD.bazel b/tools/testing/cc/BUILD.bazel index 676fedb8ad..d5b7277103 100644 --- a/tools/testing/cc/BUILD.bazel +++ b/tools/testing/cc/BUILD.bazel @@ -39,8 +39,8 @@ cc_binary( deps = [ ":cli_util", "//cc", - "//cc/integration/gcpkms:gcp_kms_aead", "//cc/integration/gcpkms:gcp_kms_client", + "//cc/integration/gcpkms:gcp_kms_aead", ], ) @@ -149,16 +149,15 @@ sh_test( ], ) -# TODO(b/119547792): Temporarily disabling until reliability concerns are addressed. -#sh_test( -# name = "gcp_kms_aead_test", -# size = "medium", -# srcs = [ -# "gcp_kms_aead_test.sh", -# ], -# data = [ -# ":gcp_kms_aead_cli", -# "//testdata:credentials", -# "//tools/testing/cross_language:test_lib", -# ], -#) +sh_test( + name = "gcp_kms_aead_test", + size = "medium", + srcs = [ + "gcp_kms_aead_test.sh", + ], + data = [ + ":gcp_kms_aead_cli", + "//testdata:credentials", + "//tools/testing/cross_language:test_lib", + ], +)