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

Side by Side Diff: src/scripts/mod_for_test_scripts/710enableAuthTesting

Issue 1566055: Add testing root certs to an nssdb on the rootfs. (Closed)
Patch Set: Created 10 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 echo "Adding mock Google Accounts server certs." 7 echo "Adding mock Google Accounts server certs."
8 8
9 # TODO(cmasone): Generate these on the fly? 9 # TODO(cmasone): Generate certs/keys on the fly from a CSR?
10 CERT_DIR="${GCLIENT_ROOT}/src/platform/login_manager" 10 CERT_DIR="${GCLIENT_ROOT}/src/platform/login_manager"
11 CERT_NAME="mock_server" 11 CERT_NAME="mock_server"
12 FAKE_CA_DIR="${ROOT_FS_DIR}/etc/fake_root_ca"
13 FAKE_NSSDB="${FAKE_CA_DIR}/nssdb"
12 14
13 cat "${CERT_DIR}/${CERT_NAME}.key" > "${ROOT_FS_DIR}/etc/${CERT_NAME}.key" 15 mkdir -p "${FAKE_NSSDB}"
16 cat "${CERT_DIR}/${CERT_NAME}.key" > "${FAKE_CA_DIR}/${CERT_NAME}.key"
17 echo "DO NOT MOVE THIS DATA OFF OF THE ROOTFS!" > "${FAKE_CA_DIR}/README"
18 nsscertutil -A -n FakeCA -t "C,C,C" -a -i "${CERT_DIR}/${CERT_NAME}.pem" \
19 -d "${FAKE_NSSDB}"
20 chmod -R 0644 "${FAKE_NSSDB}"
14 21
22 # TODO(cmasone): get rid of this once we're off pam_google for good.
15 # Sadly, our fake cert HAS to be first in this file. 23 # Sadly, our fake cert HAS to be first in this file.
16 TMPFILE=$(mktemp) 24 TMPFILE=$(mktemp)
17 CERT_FILE="${ROOT_FS_DIR}/etc/login_trust_root.pem" 25 CERT_FILE="${ROOT_FS_DIR}/etc/login_trust_root.pem"
18 PERMS=$(stat --printf="%a" "${CERT_FILE}") 26 PERMS=$(stat --printf="%a" "${CERT_FILE}")
19 cat "${CERT_DIR}/${CERT_NAME}.pem" "${CERT_FILE}" > "${TMPFILE}" 27 cat "${CERT_DIR}/${CERT_NAME}.pem" "${CERT_FILE}" > "${TMPFILE}"
20 mv -f "${TMPFILE}" "${CERT_FILE}" 28 mv -f "${TMPFILE}" "${CERT_FILE}"
21 chmod "${PERMS}" "${CERT_FILE}" 29 chmod "${PERMS}" "${CERT_FILE}"
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698