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
6539734e
Commit
6539734e
authored
Feb 01, 2012
by
Leigh B Stoller
Browse files
Do not return the public part of the derived ssh key; no reason to and
confuses the user.
parent
1ab8ee16
Changes
2
Show whitespace changes
Inline
Side-by-side
www/gensslcert.php3
View file @
6539734e
<?php
<?php
#
#
# EMULAB-COPYRIGHT
# EMULAB-COPYRIGHT
# Copyright (c) 2000-201
1
University of Utah and the Flux Group.
# Copyright (c) 2000-201
2
University of Utah and the Flux Group.
# All rights reserved.
# All rights reserved.
#
#
include
(
"defs.php3"
);
include
(
"defs.php3"
);
...
@@ -35,18 +35,32 @@ $target_uid = $target_user->uid();
...
@@ -35,18 +35,32 @@ $target_uid = $target_user->uid();
if
(
isset
(
$finished
))
{
if
(
isset
(
$finished
))
{
PAGEHEADER
(
"Download SSL Certificate for user:
$target_uid
"
);
PAGEHEADER
(
"Download SSL Certificate for user:
$target_uid
"
);
$url
=
CreateURL
(
"getsslcert"
,
$target_user
);
$sslurl
=
CreateURL
(
"getsslcert"
,
$target_user
);
$sshurl
=
CreateURL
(
"getsslcert"
,
$target_user
,
"ssh"
,
1
);
echo
"<blockquote>
echo
"<blockquote>
<a href='
$url
'>Download</a> your
<a href='
$
ssl
url
'>Download</a> your
certificate and private key in PEM format, and then save
certificate and private key in PEM format, and then save
it to a file in your .ssl directory.
it to a file in your .ssl directory.
<br>
<br>
<br>
<br>
You can also download it in <a href='
$url
&p12=1'><em>pkc12</em></a>
You can also download it in <a href='
$
ssl
url
&p12=1'><em>pkc12</em></a>
format for loading
format for loading
into your web browser (if you do not know what this means, or why
into your web browser (if you do not know what this means, or why
you need to do this, then ignore this).
you need to do this, then ignore this).
<br>
<br>
We have also created a SSH key pair for you, derived from your new
ssl certificate, using the same pass phrase.
You can <a href='
$sshurl
'>Download</a> the private
key and load it into your ssh agent. The private key is typically
placed in your .ssh directory on your desktop machine. If you are
running an agent such as
<a href='http://www.chiark.greenend.org.uk/~sgtatham/putty/'>Putty</a>
or
<a href='http://sshkeychain.sourceforge.net/'>SSHKeychain</a>,
please consult the
documentation for those programs.
</blockquote>
\n
"
;
</blockquote>
\n
"
;
PAGEFOOTER
();
PAGEFOOTER
();
...
...
www/getsslcert.php3
View file @
6539734e
...
@@ -18,13 +18,17 @@ $isadmin = ISADMIN();
...
@@ -18,13 +18,17 @@ $isadmin = ISADMIN();
#
#
$optargs
=
OptionalPageArguments
(
"target_user"
,
PAGEARG_USER
,
$optargs
=
OptionalPageArguments
(
"target_user"
,
PAGEARG_USER
,
"p12"
,
PAGEARG_BOOLEAN
,
"p12"
,
PAGEARG_BOOLEAN
,
"ssh"
,
PAGEARG_BOOLEAN
);
"ssh"
,
PAGEARG_BOOLEAN
,
"pub"
,
PAGEARG_BOOLEAN
);
if
(
!
isset
(
$p12
))
{
if
(
!
isset
(
$p12
))
{
$p12
=
0
;
$p12
=
0
;
}
}
if
(
!
isset
(
$ssh
))
{
if
(
!
isset
(
$ssh
))
{
$ssh
=
0
;
$ssh
=
0
;
}
}
if
(
!
isset
(
$pub
))
{
$pub
=
0
;
}
# Default to current user if not provided.
# Default to current user if not provided.
if
(
!
isset
(
$target_user
))
{
if
(
!
isset
(
$target_user
))
{
...
@@ -90,8 +94,11 @@ if ($ssh) {
...
@@ -90,8 +94,11 @@ if ($ssh) {
echo
"-----BEGIN RSA PRIVATE KEY-----
\n
"
;
echo
"-----BEGIN RSA PRIVATE KEY-----
\n
"
;
echo
$key
;
echo
$key
;
echo
"-----END RSA PRIVATE KEY-----
\n
"
;
echo
"-----END RSA PRIVATE KEY-----
\n
"
;
# The user does not generally need this and it causes confusion.
if
(
$pub
)
{
echo
$pubkey
;
echo
$pubkey
;
echo
"
\n
"
;
echo
"
\n
"
;
}
}
}
else
{
else
{
header
(
"Content-Type: text/plain"
);
header
(
"Content-Type: text/plain"
);
...
...
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