File: CMakeLists.txt

package info (click to toggle)
yubihsm-shell 2.6.0-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,352 kB
  • sloc: ansic: 40,972; sh: 2,322; makefile: 18; xml: 16
file content (361 lines) | stat: -rw-r--r-- 5,847 bytes parent folder | download | duplicates (2)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
#
# Copyright 2015-2018 Yubico AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

include(${CMAKE_SOURCE_DIR}/cmake/openssl.cmake)
find_libcrypto()

set (
  SOURCE_IMPORT_RSA
  import_rsa.c
  ../common/hash.c
  ../common/util.c
  ../common/openssl-compat.c
  )

set (
  SOURCE_GENERATE_EC
  generate_ec.c
  ../common/hash.c
  ../common/util.c
  ../common/openssl-compat.c
  )

set (
  SOURCEINFO
  info.c
  )

set (
  SOURCE_IMPORT_AUTHKEY
  import_authkey.c
  )

set (
  SOURCE_GENERATE_HMAC
  generate_hmac.c
  )

set (
  SOURCE_WRAP
  wrap.c
  ../common/util.c
  ../common/openssl-compat.c
  )

set (
  SOURCE_WRAP_DATA
  wrap_data.c
  )

set (
  SOURCE_ATTEST
  attest.c
  ../common/util.c
  ../common/hash.c
  ../common/openssl-compat.c
  )

set (
  SOURCE_YUBICO_OTP
  yubico_otp.c
  )

set (
  SOURCE_ECHO
  echo.c
  )

set (
  SOURCE_ASYM_AUTH
  asym_auth.c
  ../common/openssl-compat.c
  )

set (
  SOURCE_IMPORT_EC
  import_ec.c
  ../common/hash.c
  ../common/util.c
  ../common/openssl-compat.c
  )

set (
  SOURCE_GENERATE_RSA
  generate_rsa.c
  ../common/openssl-compat.c
  )

set (
  SOURCE_LOGS
  logs.c
  ../common/hash.c
  ../common/util.c
  ../common/openssl-compat.c
  )

set (
  SOURCE_SSH
  ssh.c
  ../common/hash.c
  ../common/util.c
  ../common/openssl-compat.c
  )

set (
  SOURCE_DECRYPT_RSA
  decrypt_rsa.c
  ../common/hash.c
  ../common/util.c
  ../common/openssl-compat.c
  )

set (
  SOURCE_P11_GENERATE_RSA
  p11_generate_rsa.c
  ../common/openssl-compat.c
  )

set (
  SOURCE_DECRYPT_EC
  decrypt_ec.c
  ../common/hash.c
  ../common/util.c
  ../common/openssl-compat.c
  )

set (
  SOURCE_IMPORT_ED
  import_ed.c
  ../common/hash.c
  ../common/util.c
  ../common/openssl-compat.c
  )

set (
  SOURCE_CHANGE_AUTHKEY
  change_authkey.c
  )

set(
  SOURCE_ENCRYPT_AES
  encrypt_aes.c
)

include_directories (
  ${LIBCRYPTO_INCLUDEDIR}
  ${CMAKE_CURRENT_SOURCE_DIR}/../lib
  ${CMAKE_CURRENT_SOURCE_DIR}/../pkcs11
  ${CMAKE_CURRENT_SOURCE_DIR}/../common
  )

configure_file (
  ${CMAKE_CURRENT_SOURCE_DIR}/rsa2048_pvtkey.pem
  ${CMAKE_CURRENT_BINARY_DIR}/rsa2048_pvtkey.pem
  COPYONLY)

configure_file (
  ${CMAKE_CURRENT_SOURCE_DIR}/p256_pvtkey.pem
  ${CMAKE_CURRENT_BINARY_DIR}/p256_pvtkey.pem
  COPYONLY)

configure_file (
  ${CMAKE_CURRENT_SOURCE_DIR}/attestation_template.pem
  ${CMAKE_CURRENT_BINARY_DIR}/attestation_template.pem
  COPYONLY)

configure_file (
  ${CMAKE_CURRENT_SOURCE_DIR}/ssh_ca_pvtkey.pem
  ${CMAKE_CURRENT_BINARY_DIR}/ssh_ca_pvtkey.pem
  COPYONLY)

configure_file (
  ${CMAKE_CURRENT_SOURCE_DIR}/ssh_req.dat
  ${CMAKE_CURRENT_BINARY_DIR}/ssh_req.dat
  COPYONLY)

configure_file (
  ${CMAKE_CURRENT_SOURCE_DIR}/ed25519_pvtkey.pem
  ${CMAKE_CURRENT_BINARY_DIR}/ed25519_pvtkey.pem
  COPYONLY)

add_executable (import_rsa ${SOURCE_IMPORT_RSA})

target_link_libraries (
  import_rsa
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (generate_ec ${SOURCE_GENERATE_EC})

target_link_libraries (
  generate_ec
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (info ${SOURCEINFO})

target_link_libraries (
  info
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (import_authkey ${SOURCE_IMPORT_AUTHKEY})

target_link_libraries (
  import_authkey
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (generate_hmac ${SOURCE_GENERATE_HMAC})

target_link_libraries (
  generate_hmac
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (wrap ${SOURCE_WRAP})

target_link_libraries (
  wrap
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (wrap_data ${SOURCE_WRAP_DATA})

target_link_libraries (
  wrap_data
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (attest ${SOURCE_ATTEST})

target_link_libraries (
  attest
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (yubico_otp ${SOURCE_YUBICO_OTP})

target_link_libraries (
  yubico_otp
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (echo ${SOURCE_ECHO})

target_link_libraries (
  echo
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (asym_auth ${SOURCE_ASYM_AUTH})

target_link_libraries (
  asym_auth
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (import_ec ${SOURCE_IMPORT_EC})

target_link_libraries (
  import_ec
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (generate_rsa ${SOURCE_GENERATE_RSA})

target_link_libraries (
  generate_rsa
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (logs ${SOURCE_LOGS})

target_link_libraries (
  logs
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (ssh ${SOURCE_SSH})

target_link_libraries (
  ssh
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (decrypt_rsa ${SOURCE_DECRYPT_RSA})

target_link_libraries (
  decrypt_rsa
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (decrypt_ec ${SOURCE_DECRYPT_EC})

target_link_libraries (
  decrypt_ec
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (import_ed ${SOURCE_IMPORT_ED})

target_link_libraries (
  import_ed
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable (change_authkey ${SOURCE_CHANGE_AUTHKEY})

target_link_libraries (
  change_authkey
  ${LIBCRYPTO_LDFLAGS}
  yubihsm
  )

add_executable(encrypt_aes ${SOURCE_ENCRYPT_AES})

target_link_libraries(
  encrypt_aes
  yubihsm
)

if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
  add_executable (p11_generate_rsa ${SOURCE_P11_GENERATE_RSA})

  target_link_libraries (
    p11_generate_rsa
    ${LIBCRYPTO_LDFLAGS}
    dl
    )
endif()