summaryrefslogtreecommitdiff
path: root/chromium/components/gcm_driver/crypto/gcm_crypto_test_helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/gcm_driver/crypto/gcm_crypto_test_helpers.h')
-rw-r--r--chromium/components/gcm_driver/crypto/gcm_crypto_test_helpers.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/chromium/components/gcm_driver/crypto/gcm_crypto_test_helpers.h b/chromium/components/gcm_driver/crypto/gcm_crypto_test_helpers.h
new file mode 100644
index 00000000000..8579ccf1f90
--- /dev/null
+++ b/chromium/components/gcm_driver/crypto/gcm_crypto_test_helpers.h
@@ -0,0 +1,25 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_GCM_DRIVER_CRYPTO_GCM_CRYPTO_TEST_HELPERS_H_
+#define COMPONENTS_GCM_DRIVER_CRYPTO_GCM_CRYPTO_TEST_HELPERS_H_
+
+#include "base/strings/string_piece.h"
+
+namespace gcm {
+
+struct IncomingMessage;
+
+// Creates an encrypted representation of |payload| using the |peer_public_key|
+// (as an octet string in uncompressed form per SEC1 2.3.3) and the
+// |auth_secret|. Returns whether the payload could be created and has been
+// written to the |*message|.
+bool CreateEncryptedPayloadForTesting(const base::StringPiece& payload,
+ const base::StringPiece& peer_public_key,
+ const base::StringPiece& auth_secret,
+ IncomingMessage* message);
+
+} // namespace gcm
+
+#endif // COMPONENTS_GCM_DRIVER_CRYPTO_GCM_CRYPTO_TEST_HELPERS_H_