Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: remoting/tools/keygen.py

Issue 7046012: Basic OAuth2 support using the native app flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last one Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/webapp/me2mom/background.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 import sys 6 import sys
7 7
8 SCRIPT_PATH = os.path.dirname(sys.argv[0]) 8 SCRIPT_PATH = os.path.dirname(sys.argv[0])
9 if SCRIPT_PATH == "": 9 if SCRIPT_PATH == "":
10 SCRIPT_PATH = os.getcwd() 10 SCRIPT_PATH = os.getcwd()
11 11
12 PATHS_TO_TRY = [ 12 PATHS_TO_TRY = [
13 '\\..\\..\\build\\Debug\\chromoting_host_keygen.exe', 13 '\\..\\..\\build\\Debug\\remoting_host_keygen.exe',
14 '\\..\\..\\build\\Release\\chromoting_host_keygen.exe', 14 '\\..\\..\\build\\Release\\remoting_host_keygen.exe',
15 '\\..\\Debug\\chromoting_host_keygen.exe', 15 '\\..\\Debug\\remoting_host_keygen.exe',
16 '\\..\\Release\\chromoting_host_keygen.exe', 16 '\\..\\Release\\remoting_host_keygen.exe',
17 '/../../xcodebuild/Debug/chromoting_host_keygen', 17 '/../../xcodebuild/Debug/remoting_host_keygen',
18 '/../../xcodebuild/Release/chromoting_host_keygen', 18 '/../../xcodebuild/Release/remoting_host_keygen',
19 '/../../out/Debug/chromoting_host_keygen', 19 '/../../out/Debug/remoting_host_keygen',
20 '/../../out/Release/chromoting_host_keygen'] 20 '/../../out/Release/remoting_host_keygen']
21 21
22 KEYGEN_PATH = None 22 KEYGEN_PATH = None
23 for path in PATHS_TO_TRY: 23 for path in PATHS_TO_TRY:
24 if os.path.exists(SCRIPT_PATH + path): 24 if os.path.exists(SCRIPT_PATH + path):
25 KEYGEN_PATH = SCRIPT_PATH + path 25 KEYGEN_PATH = SCRIPT_PATH + path
26 break 26 break
27 27
28 if not KEYGEN_PATH: 28 if not KEYGEN_PATH:
29 raise Exception("Unable to find chromoting_host_keygen. Please build it " + 29 raise Exception("Unable to find remoting_host_keygen. Please build it " +
30 "and try again") 30 "and try again")
31 31
32 def generateRSAKeyPair(): 32 def generateRSAKeyPair():
33 """Returns (priv, pub) keypair where priv is a new private key and 33 """Returns (priv, pub) keypair where priv is a new private key and
34 pub is the corresponding public key. Both keys are BASE64 encoded.""" 34 pub is the corresponding public key. Both keys are BASE64 encoded."""
35 pipe = os.popen(KEYGEN_PATH) 35 pipe = os.popen(KEYGEN_PATH)
36 out = pipe.readlines() 36 out = pipe.readlines()
37 if len(out) != 2: 37 if len(out) != 2:
38 raise Exception("chromoting_host_keygen failed.") 38 raise Exception("remoting_host_keygen failed.")
39 return (out[0].strip(), out[1].strip()) 39 return (out[0].strip(), out[1].strip())
OLDNEW
« no previous file with comments | « no previous file | remoting/webapp/me2mom/background.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698