-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenssl_pem.gni
35 lines (33 loc) · 1.06 KB
/
openssl_pem.gni
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
template("genopenssl_key") {
forward_variables_from(invoker,
[
"openssl_pem_in_dir",
"openssl_pem_out_dir",
"openssl_pem_algorithm",
])
if (!defined(openssl_pem_in_dir)) {
openssl_pem_in_dir = "."
}
if (!defined(openssl_pem_algorithm)) {
openssl_pem_algorithm = "rsa"
}
openssl_pem_in_dir = rebase_path(openssl_pem_in_dir)
pem_dir = "${root_gen_dir}/${openssl_pem_out_dir}"
action_foreach(target_name) {
sources = invoker.sources
script = "//common-mk/file_generator_wrapper.py"
outputs = [ "${pem_dir}/{{source_name_part}}.pub.pem" ]
args = [
"openssl",
"${openssl_pem_algorithm}",
"-in",
"${openssl_pem_in_dir}/{{source_file_part}}",
"-pubout",
"-out",
"${pem_dir}/{{source_name_part}}.pub.pem",
]
}
}