1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
8 _SCRIPT_PATH
= os
.path
.dirname(sys
.argv
[0])
10 _SCRIPT_PATH
= os
.getcwd()
14 '..\\..\\build\\Debug',
15 '..\\..\\build\\Release',
18 '../../xcodebuild/Debug',
19 '../../xcodebuild/Release',
22 '/usr/lib/chrome-remote-desktop']
25 def locate_executable(exe_name
):
26 for path
in _EXE_PATHS_TO_TRY
:
27 exe_path
= os
.path
.join(_SCRIPT_PATH
, path
, exe_name
)
28 if os
.path
.exists(exe_path
):
30 exe_path
= exe_path
+ ".exe"
31 if os
.path
.exists(exe_path
):
34 raise Exception("Could not locate executable '%s'" % exe_name
)
37 def generateRSAKeyPair():
38 """Returns (priv, pub) keypair where priv is a new private key and
39 pub is the corresponding public key. Both keys are BASE64 encoded."""
40 keygen_path
= locate_executable("remoting_host_keygen")
41 pipe
= os
.popen(keygen_path
)
42 out
= pipe
.readlines()
44 raise Exception("remoting_host_keygen failed.")
45 return (out
[0].strip(), out
[1].strip())