Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
90b8fff9
Commit
90b8fff9
authored
Mar 26, 2010
by
Srikanth Chikkulapelly
Browse files
Merge branch 'master' of srikanth@git-public.flux.utah.edu:/flux/git/emulab-devel
parents
6cfe8ad5
e8b5c8c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
protogeni/test/test-common.py
View file @
90b8fff9
...
...
@@ -137,9 +137,28 @@ def Fatal(message):
sys
.
exit
(
1
)
def
PassPhraseCB
(
v
,
prompt1
=
'Enter passphrase:'
,
prompt2
=
'Verify passphrase:'
):
passphrase
=
open
(
PASSPHRASEFILE
).
readline
()
passphrase
=
passphrase
.
strip
()
return
passphrase
"""Acquire the encrypted certificate passphrase by reading a file
or prompting the user.
This is an M2Crypto callback. If the passphrase file exists and is
readable, use it. If the passphrase file does not exist or is not
readable, delegate to the standard M2Crypto passphrase
callback. Return the passphrase.
"""
if
os
.
path
.
exists
(
PASSPHRASEFILE
):
try
:
passphrase
=
open
(
PASSPHRASEFILE
).
readline
()
passphrase
=
passphrase
.
strip
()
return
passphrase
except
IOError
,
e
:
print
'Error reading passphrase file %s: %s'
%
(
PASSPHRASEFILE
,
e
.
strerror
)
else
:
if
debug
:
print
'passphrase file %s does not exist'
%
(
PASSPHRASEFILE
)
# Prompt user if PASSPHRASEFILE does not exist or could not be read.
from
M2Crypto.util
import
passphrase_callback
return
passphrase_callback
(
v
,
prompt1
,
prompt2
)
#
# Call the rpc server.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment