1#
2# Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
3#
4# Licensed under the Apache License 2.0 (the "License").  You may not use
5# this file except in compliance with the License.  You can obtain a copy
6# in the file LICENSE in the source distribution or at
7# https://www.openssl.org/source/license.html
8
9# Tests start with one of these keywords
10#       Cipher Decrypt Derive Digest Encoding KDF MAC PBE
11#       PrivPubKeyPair Sign Verify VerifyRecover
12# and continue until a blank line. Lines starting with a pound sign are ignored.
13
14
15# Private keys used for PKEY operations.
16
17# DSA key
18PrivateKey=DSA-1024
19-----BEGIN PRIVATE KEY-----
20MIIBSwIBADCCASwGByqGSM44BAEwggEfAoGBAO0SwRpkAeM21qSM5ch4CLEHpFk4
2119R5ve1UUr421y3HEUURsrVpxYKvyx8aOBQC/akz95cYxNN3y1JnJJMxPklhdJrJ
22f/WDYPxjMk8BqNJmeZtLuCVLKGwQomuo7ZkG955WRyLHYEdQ6uC7K2QTPKpW6psF
23YFaDYjAjSEKk2MFxAhUAykDkKLZdhPWzwM8/qYaE31VmWz0CgYEApNVF8oFK41ez
24Qci9XbSZJHyPB+3jML1YQkHxiiInaIz6GEFtjUbIUEYA/ovY+6ECNI1aIDHTd7CH
25woS0mp33oQYs43nt29B6UwbtMmbzCOQ9vGGwWVho+JtHyyPWrDuLmkvLtoQPaxYt
266PVa3gncr2v3njcVuH+EQ6DuFR93zksEFgIUbyv6pqH+UQurernJn/7sUm2U2i0=
27-----END PRIVATE KEY-----
28
29PublicKey=DSA-1024-PUBLIC
30-----BEGIN PUBLIC KEY-----
31MIIBtzCCASwGByqGSM44BAEwggEfAoGBAO0SwRpkAeM21qSM5ch4CLEHpFk419R5
32ve1UUr421y3HEUURsrVpxYKvyx8aOBQC/akz95cYxNN3y1JnJJMxPklhdJrJf/WD
33YPxjMk8BqNJmeZtLuCVLKGwQomuo7ZkG955WRyLHYEdQ6uC7K2QTPKpW6psFYFaD
34YjAjSEKk2MFxAhUAykDkKLZdhPWzwM8/qYaE31VmWz0CgYEApNVF8oFK41ezQci9
35XbSZJHyPB+3jML1YQkHxiiInaIz6GEFtjUbIUEYA/ovY+6ECNI1aIDHTd7CHwoS0
36mp33oQYs43nt29B6UwbtMmbzCOQ9vGGwWVho+JtHyyPWrDuLmkvLtoQPaxYt6PVa
373gncr2v3njcVuH+EQ6DuFR93zksDgYQAAoGAVXFwJ5wTuF0rQ6AWfTitm3/zUeRW
38SeKFo+Rg0GrBI+Wg2Tj+Yn6V8Xs+Xyjim1wsd2P6/BlJzCEr4nHjP9JcBICqM3vI
399zCaT/vYsLD7/T7rF9AF/jV+LnkGJCzLbDYF04IkhtLNHOQob+Uc8PWB78e/1Lc4
40SzJw2oHciIOt+UU=
41-----END PUBLIC KEY-----
42
43PrivPubKeyPair = DSA-1024:DSA-1024-PUBLIC
44
45Title = DSA tests
46
47FIPSversion = >=3.4.0
48Verify = DSA-SHA1:DSA-1024
49Input = "0123456789ABCDEF1234"
50Output = 302d021500942b8c5850e05b59e24495116b1e8559e51b610e0214237aedf272d91f2397f63c9fc8790e1a6cde5d87
51
52FIPSversion = >=3.4.0
53Verify = DSA-SHA1:DSA-1024-PUBLIC
54Input = "0123456789ABCDEF1234"
55Output = 302d021500942b8c5850e05b59e24495116b1e8559e51b610e0214237aedf272d91f2397f63c9fc8790e1a6cde5d87
56
57# Modified signature
58FIPSversion = >=3.4.0
59Verify = DSA-SHA1:DSA-1024-PUBLIC
60Input = "0123456789ABCDEF1234"
61Output = 302d021500942b8c5850e05b59e24495116b1e8559e51b610e0214237aedf272d91f2397f63c9fc8790e1a6cde5d88
62Result = VERIFY_ERROR
63
64# Digest too short
65FIPSversion = >=3.4.0
66Verify = DSA-SHA1:DSA-1024-PUBLIC
67Input = "0123456789ABCDEF123"
68Output = 302d021500942b8c5850e05b59e24495116b1e8559e51b610e0214237aedf272d91f2397f63c9fc8790e1a6cde5d87
69Result = VERIFY_ERROR
70
71# Digest too long
72FIPSversion = >=3.4.0
73Verify = DSA-SHA1:DSA-1024-PUBLIC
74Input = "0123456789ABCDEF12345"
75Output = 302d021500942b8c5850e05b59e24495116b1e8559e51b610e0214237aedf272d91f2397f63c9fc8790e1a6cde5d87
76Result = VERIFY_ERROR
77
78# Garbage after signature
79FIPSversion = >=3.4.0
80Verify = DSA-1024-PUBLIC
81Input = "0123456789ABCDEF1234"
82Output = 302d021500942b8c5850e05b59e24495116b1e8559e51b610e0214237aedf272d91f2397f63c9fc8790e1a6cde5d8700
83Result = VERIFY_ERROR
84
85# Invalid tag
86FIPSversion = >=3.4.0
87Verify = DSA-SHA1:DSA-1024-PUBLIC
88Input = "0123456789ABCDEF1234"
89Output = 312d021500942b8c5850e05b59e24495116b1e8559e51b610e0214237aedf272d91f2397f63c9fc8790e1a6cde5d87
90Result = VERIFY_ERROR
91
92# BER signature
93FIPSversion = >=3.4.0
94Verify = DSA-SHA1:DSA-1024-PUBLIC
95Input = "0123456789ABCDEF1234"
96Output = 3080021500942b8c5850e05b59e24495116b1e8559e51b610e0214237aedf272d91f2397f63c9fc8790e1a6cde5d870000
97Result = VERIFY_ERROR
98
99Title = Test keypair mismatches
100
101PrivateKey = DSA-1024-BIS
102-----BEGIN PRIVATE KEY-----
103MIIBSwIBADCCASwGByqGSM44BAEwggEfAoGBAO0SwRpkAeM21qSM5ch4CLEHpFk419R5ve1UUr42
1041y3HEUURsrVpxYKvyx8aOBQC/akz95cYxNN3y1JnJJMxPklhdJrJf/WDYPxjMk8BqNJmeZtLuCVL
105KGwQomuo7ZkG955WRyLHYEdQ6uC7K2QTPKpW6psFYFaDYjAjSEKk2MFxAhUAykDkKLZdhPWzwM8/
106qYaE31VmWz0CgYEApNVF8oFK41ezQci9XbSZJHyPB+3jML1YQkHxiiInaIz6GEFtjUbIUEYA/ovY
107+6ECNI1aIDHTd7CHwoS0mp33oQYs43nt29B6UwbtMmbzCOQ9vGGwWVho+JtHyyPWrDuLmkvLtoQP
108axYt6PVa3gncr2v3njcVuH+EQ6DuFR93zksEFgIUFQFshP0hj7i6ClXkSPYoFW6KrIY=
109-----END PRIVATE KEY-----
110
111PublicKey = DSA-1024-BIS-PUBLIC
112-----BEGIN PUBLIC KEY-----
113MIIBtzCCASwGByqGSM44BAEwggEfAoGBAO0SwRpkAeM21qSM5ch4CLEHpFk419R5
114ve1UUr421y3HEUURsrVpxYKvyx8aOBQC/akz95cYxNN3y1JnJJMxPklhdJrJf/WD
115YPxjMk8BqNJmeZtLuCVLKGwQomuo7ZkG955WRyLHYEdQ6uC7K2QTPKpW6psFYFaD
116YjAjSEKk2MFxAhUAykDkKLZdhPWzwM8/qYaE31VmWz0CgYEApNVF8oFK41ezQci9
117XbSZJHyPB+3jML1YQkHxiiInaIz6GEFtjUbIUEYA/ovY+6ECNI1aIDHTd7CHwoS0
118mp33oQYs43nt29B6UwbtMmbzCOQ9vGGwWVho+JtHyyPWrDuLmkvLtoQPaxYt6PVa
1193gncr2v3njcVuH+EQ6DuFR93zksDgYQAAoGAdZCPYZ9WvtKW7dFvbEjl0HHBxLNX
1208kV1/FAxsDrQd+c8mWdruNzcmwsZJklJuTK9czKnXgLmkRHR20I4oNrJ/bptV8lV
121iDvJBJlmZ1aGh6yLIHzYBbgbgia3lBrFlO5qUxNmbNeiC+HIqUvlVBmQOLN6+Xjn
122Q4A0wDK8dmF2dFI=
123-----END PUBLIC KEY-----
124
125PrivPubKeyPair = DSA-1024-BIS:DSA-1024-BIS-PUBLIC
126
127PrivPubKeyPair = DSA-1024:DSA-1024-BIS-PUBLIC
128Result = KEYPAIR_MISMATCH
129
130PrivPubKeyPair = DSA-1024-BIS:DSA-1024-PUBLIC
131Result = KEYPAIR_MISMATCH
132
133
134PrivateKey = DSA-1024-FIPS186-2
135-----BEGIN PRIVATE KEY-----
136MIIBWgIBADCCATMGByqGSM44BAEwggEmAoGBALRSnNcjMPIl4tekT5D3AgqsK042
137Ar1dGKeJCmWrSngAELtSH0yZCwsbl7wLEgG2lfusbn5sdtbpFioKInohZruRhzwC
13859GRXjAFD0QPhVE/qy6Oto+8WIHAa/RiEIkxRfTiAe9Ach56k9lZYONDUHDqH38u
139UIfjoUN+jlzoJcWbAh0A6TfgjmB+CxvxG/2pz8OAXXfNP8/JLfYvolE/fwKBgH7l
140jLeoOofKc+rwO2Fha8nuFddXRSePZKzC7mRQsPXwfvX5V6msU2xizjdPIsqVu7qA
141Bcc1YMd7/5C3vaKuS21DxBOs7nAHbO9ZZtGlpUAnJwM/P09nMb3yG6tR9LF3AQmu
142Kr2KShQB0FlSgvcCDTX7g8eJ/UuIWo6wX4hSdHDhBB4CHAdVVg1m5ikOICUBo37Y
143/TqkTaCFsMDwcDc20Jg=
144-----END PRIVATE KEY-----
145
146PrivateKey = DSA-2048-160
147-----BEGIN PRIVATE KEY-----
148MIICTAIBADCCAi0GByqGSM44BAEwggIgAoIBAQCOypCJyAO7uNZSPSNGalSkyjQC
149xdFVIGfMJKjEXzJnH4g3ts0UqUyO8126REDJEXDeMi22841xsSvzz0ZJeT5YvMLW
150t1BtSTiYg2QOar1qEGJunHgjsWKJbVzIqWNw60ZP7pNKmlR7PKa3WDaPhdeVP8zJ
151PEMeUHOSprO5Jk/Hjr8jxV0znIIixb9L9PgJAwxiM7rkRHS2Oz1FCYDmNmuFhQDh
152Cb3wY9t1AcAHZ05uZ4PtNjdRPwFLPeVdckPj0ntApvOrH18xPWBmwcVeHAH1SV2k
1537LPK7wILHVzcKm74ubX/s1wKysyyXyKM+oCgG9jvfh09VQJcHTHaVS643ohZAhUA
154uQMLDZqMQbh9TYlm9xYCEBaeVs0CggEAcum3PgEQIRfukytMQ7gKMyfxHqhMmJ6t
155RolRhgMrSfl99dmMoqJV+sdSjYvZSkwl71N1Y4Al8GcJB1SzTSb8qGRzM+43pa4k
156SyQZ62WA8w5gaIQJ85JUrWiT8C6SgwAbruS5BVHRbQD6FxZwro9+s8uPnLesMTQX
157p4maNSQaqYX7tqGl6Z7Wo0PsEwuDRvBlI6sl97gl4q3FQPByCq/64UW/eF6Illo1
158dpfbiWCszsp8oczXCEuP+2Y67WUIj3LjFA7WM/R8K4SfdMQ/VXY/cyRhlUqQl8Qe
159ndBVKe0IeSdqvMcLNoUip7DGcOXW2ogZl+wgeP4xL3pdo8uS025kjwQWAhRfutAE
160r/MlbdGMvcA7l0XmzzY85w==
161-----END PRIVATE KEY-----
162
163PrivateKey = DSA-2048-224
164-----BEGIN PRIVATE KEY-----
165MIICXAIBADCCAjUGByqGSM44BAEwggIoAoIBAQDVjuiHR3XA9yAjToNQOmdg2rN9
1660A4mIEV3XGy1nqaKZXdavdXcsAGLmttZ/gfiHi0JNh3rxj4dbvcaN+K0IWXq6hAY
1676ZOvDZ0FH5DRH63Ecd8fWY/BMDr178sOINkPG8hLRmYcrAp/4woMBPxkEtQBfl4R
168POus+OYS4sJpl8wEgfy0HhLXkkN4YQhBf57NvQ7+LcwaErDcNLRguI3TRzflhNEh
169ieBfYtIIgISIi0yMsxOINopuHeAmcANLjyUqkQ44xcJ0kM+OoAKFq/XukkTj++iP
1709Okh+bmNEo23RtM4qqScZyUIX4bPyynbkMdu01ZG+q8PEhyoxGpHkMT6kYHBAh0A
171/rbeX9L8STLoLIsLUMbdPVLWvnLyLooSygawvwKCAQAhscCNIY/bPZ6DRULS8i4G
1720f+9chMR+C5tNykaTzCUxRjObOWKu0z1JyViiafcAoV8j1e64xRxA4a8g9RrKilK
173KztCJfwIJCeHIjHi/dvIR0z1SDeNNVpFacAT+DF5G+sMqS8Mael0MnEcR2sNkw+1
174MVIO5tinKWAFM087hsSmKs/uIvdVexH2ptKKehxTFjs8ySfAMiMfqhaC2JgPCFL1
175jUpAIvs4oCx2yZKvq+TzJOq8LRHG3qSHa0BcNVPKfVkmVJRg4ETzza1/e14Re1BR
176si7RL7EtHuFiFjYiWTGueT+e0jdBS8CoafD1V/I7NPqVmGc5NeaRv4n+ESpDSX+z
177BB4CHBN2hfQxLXg+t/MNcza5M0WoAWna5JzQBAtDzIM=
178-----END PRIVATE KEY-----
179
180PrivateKey = DSA-2048-256
181-----BEGIN PRIVATE KEY-----
182MIICZQIBADCCAjoGByqGSM44BAEwggItAoIBAQDAuDj/d/t7n4013h18atbOYg4Q
183oWZPLmA7MvFABqrlv9lfa0dRGhOHyXClHh2bsNMwk3txKjTaTwjM9v80xe47y2lv
18434DPEKaWf+6HGcsu313kjIoAITO61HK0TJXjm0BV2uzZQFmvVHwEZmt7uGFcTc4t
185Vl71Z+MjhlMqpOmXIL/OBJkMOE1CXF/b6oKyXJvyZRpE4oxS+8B1l7d/N0B1XhQl
186EMToFwmvsKfeeK24wDfxasfbNbQ7Zih/5HylWtNXbvldnOf6cfPPPM6FO7HVI9R5
187llQKxFWujVrX0IOXu89xT8t+/ICKJtLKD5HzmeH1Y6LO+Qnsu5tW8IhnDHKLAiEA
188prlohsCeURHqsKcqtMElD7vg+Ati8OKgdo79/ktz9bMCggEBALC9Awm0lClgvefU
189inwV6gQppvAQttX7fUGjnrmuAXjw/pm4MBuzkR1P7vm2IY51+SopK+ZvgXXXnWGQ
190m8y3DCuoSnfE6Y+NpAfL9iJxy5W+ByvW75GW7/Lj5hR/igKKuYhfGYT/2eIGtdQ2
191C2tcWTcV7Gfk60WSw9eLUtKCUjBHaoFHFMo3MWH64Fc0xVEQ1DLgEC5Y3TLmiLBx
192VOGpp5ZFeAc52n/W4afbBcQ5ifGFPwgcS7+WdnUUs7awuCCldh74kz58kdTJAztZ
193ZjjK728BYEE4P6itUNtr3jgNzhqwTBFvOwWCQA//a7vpyqtHMzDmpcVuDx6f4iP3
194aghyxFAEIgIgK1Ct6iRtcq01mdt4EGRrkiAHBr5zTcAgbv5ZaU99pmQ=
195-----END PRIVATE KEY-----
196
197PrivateKey = DSA-3072-256
198-----BEGIN PRIVATE KEY-----
199MIIDZgIBADCCAzoGByqGSM44BAEwggMtAoIBgQCvf6pPUvu2J7j4aaGcpEkfjX7e
200DvM5qlpuf2GDwbWFQpkxeRFtmd5EFbgNvRMsLyfTA3KWd4k2nFug2Uf5kFJ0rOcI
201nToVcrPjg8onD43Rcknvmu5grsjDvCFMmWFu361LbWxZCgGCwSUv4P647kS5ccaD
202k0o4f+a8YWLahop/HowqoN8/TvC/izdN0WvRYKeegJcBzaaBKWsBS8ucu0jEh5S3
203PCAQRFoKNRPjUzjIhycIlpdmI5BG72SkvSSMef9wvGl72FN2t3v5dbWjl7QgghU5
2040BB/RlueApJgrFhadE/0ZJKSukPMbL9a0L1xZl01iJYraa76rn5weVkU8sW7BN7C
205oHTovusrls/AtEBKXKC47rNnfSc9VwfwdNBuvs33Ga872575bjOunQiXQRxuuqjq
206u3MyixPygIy+MmjhjPhnpYnb+1sytpoN1UOTi9QMHWLp2ExYvurda6n4nCjbJBcB
207DvWPyapslDP+yT/3aEH0ctqu/QMk3rPxBAzVytUCIQD/CwBYEWtyd6IoiqcWVMT5
2084k1cKfg5ZbNu7mG3iS+iSwKCAYEAm1QNpGrOS2orCVUP80KQFTQwg37tlynJjXev
209ORdBgDXpIjFcdEgsEx9cHzlOywBDQWxHLXRukvgQbx7dCq2RgEM6Fo6ngbhj87zw
210dLFdXxj/TU0fJPhj3VIF2qu5vG1SZRu4zKNZ6uoJP7R4/7o/shHOoTyCOigRew4X
211A2P9eIxpEv/KXRznxjG1IcAQJcPYBDwjE555WNHL0jzzKEyxyxmkm9ThEpleW7HU
212ij78B5O45V/AHVF7oB/L+Aqmbc2dZy8EtShsMKqSMdFWjV0BnuzsPt9KmKT+rbj6
213MpqgdaKPEsYVD4Nk6EWEyYbWmELtS9jKH5E4Z/pqFGeamsiD5Sn0ap7SGa81BtA+
214s7FMG851b2jtRw0RB4+boGx0Lt43WbytfmW445i4h/NMB0nE/pzjIIjD3URdNoaS
2152G2eZcW/aC9bKkOoAr2USSlgylPCkz2a/CAx7i925HOZ2dw9HJ940vkAoxP+nMQv
216kMzKKeM5QVgAeRwjDqRk9uCWD7VyBCMCIQDxycQrIIL4PxAoPIM7//v8mL7A3YSW
217o3mO5AXuBuEe2g==
218-----END PRIVATE KEY-----
219
220PrivateKey = DSA-3072-224
221-----BEGIN PRIVATE KEY-----
222MIIDXAIBADCCAzUGByqGSM44BAEwggMoAoIBgQDEY9anVQ8qwdz77IQx1bSmu5MI
223mP7pf9IUXbH5fZFrCjlDu34w2WvsdDRrM2/isvKb/wj+sgg5dx5bWRn/+xolwu8l
224upmD6KMJ07t9SSla155tkvS/8hU5AD8elH9vV+HlTPKRHNF1X3jFJRVay64O+vFX
225WRe7t3yBFv/VqkhnYwm5aymMK6/TXR1znJzrMNgU1Ao3unhjaFnRsldHVHjXrA4y
226rJRMsa4r5BCPQNK8iXKabAw19oiRbRvqs3YfzoR1HqZ3LGO1/p9ECoc/QW0uI1Za
227LYQli1aNtNmtYhwKvy7O8IzjrbjkDRgl/TtDmtfpDnM6FkQebgU0OxQXTOwZgtEV
228a7VY+EwG1q+Qab7uvuO2YJ7Mk2JKmu4u0Gz7tq5N+hEN4P5UMC/MUw6ftLCGN6l6
229ycEJHMgGzDsAKEJW6NcXneY3vXpdaRGnuxyUKI86wQd3Qg1Mm3H1gqtkd48owIJm
230RtE/u91T4OJOcwVm2FxDgmMsb0LwqAELL+I9RH8CHQDNAddLZ4ovSccoD+s06I+X
231d+GzJ8cNcbn4H1TVAoIBgAmwgz0CjHaacOiXcQ4GLw0kN2IpXKAXYma1vDlDcesT
232lY8dcGsX2UjuLnfegMRkb5FMGZ8TDjgDG4vLo2p1ybt7S7s0hn56bju5HZLSOmAp
233nu5M15iZxDzgVvhRkB0EG/aw5i6iq22JUA5SUAGYLemcZIuukIDu6vhTeK2125qa
234q+Uc0/kyPMOf0zABo+I2wWNmZgdq26F147Yrf06VY3ekxcER1vAUfVBHxeYPfdZR
235N8ztdzYTPtCSxyIWATUxYvWxsaxqNckjXLZp5t9L72Zc8k5swsBDIAabhJTiQrRS
236hkhD0UOCf2pUNFcHIxLqYskOycEjtmKrAYbrHZDRw5CzP5ABaDYwqgxi2ZSt/tv4
237iYUhX4tRicGeAWLM7D3LxG+P/6q7dJ/Gjjx8gmbcBJKcjVDGp/b8xn1WY83gbNEJ
238HOAqdXyxgnQL+E581jk13LixzoOboyrhryFqVoMarZOXEAQKToG24tj5DO7LmviW
2398hzXTwJmVlKblGJxVmqDuQQeAhx6PjOtN4DxhxZdoX8+lU7C6CWYvyQbJOER0XVn
240-----END PRIVATE KEY-----
241
242PrivateKey = DSA-4096-256
243-----BEGIN PRIVATE KEY-----
244MIIEZQIBADCCBDoGByqGSM44BAEwggQtAoICAQD9m23nz0MOXi3GFvuv+Qpva9Ms
245oZ/oPS1sYy/JtxvBtEjWv0b0wxtLAiASkBBhaqC1Qy+9O7dC7s5wze/0v/mAxFtF
246X18KhMWSRtgiGOWzg6Nyog+Dus224Qa6wfYC1+lcGG/TmDLSmukBrVzd/71pSOkT
2476O3v5hx1JOdJzzNPt1kjq31B1/2h9OXnARg1JDCLHP6fxRkWj2ThwU+FwlKTpo+d
248MsC0Xl93t1lBOiS5VsHLSZIeqsInEj3bWBTT6C5q0huZKBQ9iT3SwAq/gG8KL9DV
249MGSWQwAQdUpQWcv6JDwLb6h6QhHmzclDCF8JAGRzLA9kDWbmYPXQuVxj1//LuJba
250fMe6tLWBuAMeQNFuB/pro2dszbo8GDOYEaOfogG86x9hfgBoPufU0oHlfhj3nhO8
251cLYwvhRkN/ZZyTM5/1aHQNvp6S+sIGD1WFKPxMZuTH2k01I0s8ESGrlWpnPgwNQx
252iwx+dlXLFZNdDOiS+Mb9JPSuJ/xDagHmQzG0gxYiLfWQKjAMol4niB6mGIm0gEYq
253Rw9OEHE/ghzBMbr6M+BLDm7PDac5y1a3L6l9e0Yq9h+4bwqTqZIpNIsRS4A0lmXd
254IXs54dQmTwF75cMWjOAOYwxua97I4Ci3nkJWiozBugoGrKTSkeNX21uMfVJKidjd
255j79Vlz79qnMSB42sqwIhAPwv8XkIkZvnDKTTowvUy8L6V/SxF7KZFtvX5Mx4KJt7
256AoICAQDdWpUSEpBLdFiu6MzqdWnRv9pt8BEu0sC9Z+xE3VrpDKqqnK2Rhtye0yIk
2574fofLl9VF2J4P6hzDcCu8QEDj0K3dWQR+BU1WMBHMCTHrTM51XAqbjR1H3ZYWVxC
258WgWrVGQkcD55TrM2RYBKH6Wa7K9HeFVJcdHrh0AZb4lXIBZHf0+71cOfZH8w1ufl
259yKzYNMGY9+eoU3Pm0D5gBO/69uWDrK21SJMW3Fpqm4rgeHtNhR4oI6cagyo2+XfD
260e+ivCk5XKCXgImKpKDMuKhJy0K4vZFjVHeIWl2mf1zyhmCxuAcGEf9dRVKtnQQGS
2618uJGddKuda67J9vecN78H2nhsZcU9DRPzgjW+tUTwSX3ycW/hEA65kN5PUSpj8Ax
2627gZN5Jn8bGNlCgLItHQMscGDo0L47+bN8G8JguZr+hpNFKmYMpbQ15yHaRU7DR36
263Zx91SEQ1o8Kn8mNT37RBYk/vZij9P8QRnn3pen9Ha5CBNs6/8RERaUJ84kSCV0iL
2644/ed3syr8bek8a2rN6qhLZSKfYwLdiu0VaBsmJrOoE7xNgJ+f0g7aTptO1NOiwtY
265ftiDvljQGG1QhAv9i1uSmz6EPYn3VCJPadxX8mlPmpGCewk8ycOV1IFgCK86cdTl
266bDfJavyQoCWW6EF260m2+rWtl6ILGhhWIbDN5KfXBhrOPvxvHQQiAiBZM1KxUjGw
267h2C/91Z0b0Xg4QYNOtVUbfqQTJQAqEpaRg==
268-----END PRIVATE KEY-----
269
270Title = FIPS Tests (using different key sizes and digests)
271
272# Test sign with a 2048 bit key with N == 160 is not allowed in fips mode
273Availablein = fips
274FIPSversion = >=3.4.0
275Sign-Message = DSA-SHA256:DSA-2048-160
276Input = "Hello"
277Output = 00
278Result = KEYOP_INIT_ERROR
279
280# Test sign with a 2048 bit key with N == 224 is allowed in fips mode
281Availablein = default
282FIPSversion = >=3.4.0
283Sign-Message = DSA-SHA256:DSA-2048-224
284Input = "Hello"
285Output = 00
286Result = KEYOP_MISMATCH
287
288# Test sign with a 2048 bit key with N == 256 is allowed in fips mode
289Availablein = default
290FIPSversion = >=3.4.0
291Sign-Message = DSA-SHA256:DSA-2048-256
292Input = "Hello"
293Result = KEYOP_MISMATCH
294
295# Test sign with a 3072 bit key with N == 256 is allowed in fips mode
296Availablein = default
297FIPSversion = >=3.4.0
298Sign-Message = DSA-SHA256:DSA-3072-256
299Input = "Hello"
300Result = KEYOP_MISMATCH
301
302# Test sign with a 2048 bit SHA3 is allowed in fips mode
303Availablein = default
304FIPSversion = >=3.4.0
305Sign-Message = DSA-SHA3-224:DSA-2048-256
306Input = "Hello"
307Result = KEYOP_MISMATCH
308
309# Test verify with a 1024 bit key is allowed in fips mode
310FIPSversion = >=3.4.0
311Verify-Message = DSA-SHA256:DSA-1024
312Input = "Hello "
313Output = 302c02142e32c8a5b0bd19b2ba33fd9c78aad3729dcb1b9e02142c006f7726a9d6833d414865b95167ea5f4f7713
314
315# Test verify with SHA1 is allowed in fips mode
316FIPSversion = >=3.4.0
317Verify-Message = DSA-SHA1:DSA-1024
318Input = "Hello "
319Output = 302c0214602d21ed37e46051bb3d06cc002adddeb4cdb3bd02144f39f75587b286588862d06366b2f29bddaf8cf6
320
321# Test verify with a 2048/160 bit key is allowed in fips mode
322FIPSversion = >=3.4.0
323Verify-Message = DSA-SHA256:DSA-2048-160
324Input = "Hello"
325Output = 302e021500a51ca7f70ae206f221dc9b805bb04bfc07d6e448021500b16e45f9dac8aff04e115f96c00f4237d0fced41
326
327Title = Fips Negative Tests (using different key sizes and digests)
328
329# Test sign with a 1024 bit key is not allowed in fips mode
330Availablein = fips
331FIPSversion = >=3.4.0
332Sign-Message = DSA-SHA256:DSA-1024-FIPS186-2
333Securitycheck = 1
334Input = "Hello"
335Result = KEYOP_INIT_ERROR
336
337# Test sign with SHA1 is not allowed in fips mode
338Availablein = fips
339FIPSversion = >=3.4.0
340Sign-Message = DSA-SHA1:DSA-2048-256
341Securitycheck = 1
342Input = "Hello"
343Result = KEYOP_INIT_ERROR
344
345# Test sign with a 3072 bit key with N == 224 is not allowed in fips mode
346Availablein = fips
347FIPSversion = >=3.4.0
348Sign-Message = DSA-SHA256:DSA-3072-224
349Securitycheck = 1
350Input = "Hello"
351Result = KEYOP_INIT_ERROR
352
353# Test sign with a 4096 bit key is not allowed in fips mode
354Availablein = fips
355FIPSversion = >=3.4.0
356Sign-Message = DSA-SHA256:DSA-4096-256
357Securitycheck = 1
358Input = "Hello"
359Result = KEYOP_INIT_ERROR
360
361Title = Fips Indicator Tests
362# Check that the indicator callback is triggered
363
364# Test sign with a 1024 bit key is unapproved in fips mode if the sign and key
365# checks are ignored.
366Availablein = fips
367FIPSversion = >=3.4.0
368Sign-Message = DSA-SHA256:DSA-1024-FIPS186-2
369Securitycheck = 1
370Unapproved = 1
371CtrlInit = sign-check:0
372CtrlInit = key-check:0
373Input = "Hello"
374Result = KEYOP_MISMATCH
375
376# Test sign with a 1024 bit key is unapproved and fails the key check in
377# fips mode if the sign check is ignored
378Availablein = fips
379FIPSversion = >=3.4.0
380Sign-Message = DSA-SHA256:DSA-1024-FIPS186-2
381Securitycheck = 1
382Unapproved = 1
383CtrlInit = sign-check:0
384Input = "Hello"
385Result = KEYOP_INIT_ERROR
386
387# Test sign with a 3072 bit key with N == 224 is not allowed in fips mode if the
388# sign and key checks are ignored
389Availablein = fips
390FIPSversion = >=3.4.0
391Sign-Message = DSA-SHA256:DSA-3072-224
392Securitycheck = 1
393Unapproved = 1
394CtrlInit = sign-check:0
395CtrlInit = key-check:0
396Input = "Hello"
397Result = KEYOP_MISMATCH
398
399# Test sign with a 4096 bit key is unapproved in fips mode if the sign and key
400# checks are ignored
401Availablein = fips
402FIPSversion = >=3.4.0
403Sign-Message = DSA-SHA256:DSA-4096-256
404Securitycheck = 1
405Unapproved = 1
406CtrlInit = sign-check:0
407CtrlInit = key-check:0
408Input = "Hello"
409Result = KEYOP_MISMATCH
410
411# Test sign with SHA1 is unapproved in fips mode if DSA sign check is ignored
412Availablein = fips
413FIPSversion = >=3.4.0
414Sign-Message = DSA-SHA1:DSA-2048-256
415Securitycheck = 1
416Unapproved = 1
417CtrlInit = sign-check:0
418Input = "Hello"
419Result = KEYOP_INIT_ERROR
420