]>
Commit | Line | Data |
---|---|---|
8f6f1441 | 1 | /* |
6738bf14 | 2 | * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. |
4602cc85 | 3 | * Copyright (c) 2013-2014 Timo Teräs <timo.teras@gmail.com> |
8f6f1441 | 4 | * |
846e33c7 RS |
5 | * Licensed under the OpenSSL license (the "License"). You may not use |
6 | * this file except in compliance with the License. You can obtain a copy | |
7 | * in the file LICENSE in the source distribution or at | |
8 | * https://www.openssl.org/source/license.html | |
8f6f1441 | 9 | */ |
846e33c7 | 10 | |
8f6f1441 | 11 | #include "apps.h" |
dab2cd68 | 12 | #include "progs.h" |
8f6f1441 | 13 | |
6616429d | 14 | #if defined(OPENSSL_SYS_UNIX) || defined(__APPLE__) || \ |
5c80e2af | 15 | (defined(__VMS) && defined(__DECC) && __CRTL_VER >= 80300000) |
8f6f1441 TT |
16 | # include <unistd.h> |
17 | # include <stdio.h> | |
18 | # include <limits.h> | |
19 | # include <errno.h> | |
20 | # include <string.h> | |
21 | # include <ctype.h> | |
22 | # include <sys/stat.h> | |
23 | ||
2ac915f1 RL |
24 | /* |
25 | * Make sure that the processing of symbol names is treated the same as when | |
26 | * libcrypto is built. This is done automatically for public headers (see | |
27 | * include/openssl/__DECC_INCLUDE_PROLOGUE.H and __DECC_INCLUDE_EPILOGUE.H), | |
28 | * but not for internal headers. | |
29 | */ | |
30 | # ifdef __VMS | |
31 | # pragma names save | |
32 | # pragma names as_is,shortened | |
33 | # endif | |
34 | ||
8f6f1441 | 35 | # include "internal/o_dir.h" |
2ac915f1 RL |
36 | |
37 | # ifdef __VMS | |
38 | # pragma names restore | |
39 | # endif | |
40 | ||
8f6f1441 TT |
41 | # include <openssl/evp.h> |
42 | # include <openssl/pem.h> | |
43 | # include <openssl/x509.h> | |
44 | ||
45 | ||
6616429d RL |
46 | # ifndef PATH_MAX |
47 | # define PATH_MAX 4096 | |
48 | # endif | |
c9c84a13 AG |
49 | # ifndef NAME_MAX |
50 | # define NAME_MAX 255 | |
51 | # endif | |
8f6f1441 TT |
52 | # define MAX_COLLISIONS 256 |
53 | ||
54 | typedef struct hentry_st { | |
55 | struct hentry_st *next; | |
56 | char *filename; | |
57 | unsigned short old_id; | |
58 | unsigned char need_symlink; | |
59 | unsigned char digest[EVP_MAX_MD_SIZE]; | |
60 | } HENTRY; | |
61 | ||
62 | typedef struct bucket_st { | |
63 | struct bucket_st *next; | |
64 | HENTRY *first_entry, *last_entry; | |
65 | unsigned int hash; | |
66 | unsigned short type; | |
67 | unsigned short num_needed; | |
68 | } BUCKET; | |
69 | ||
70 | enum Type { | |
71 | /* Keep in sync with |suffixes|, below. */ | |
72 | TYPE_CERT=0, TYPE_CRL=1 | |
73 | }; | |
74 | ||
75 | enum Hash { | |
76 | HASH_OLD, HASH_NEW, HASH_BOTH | |
77 | }; | |
78 | ||
79 | ||
80 | static int evpmdsize; | |
81 | static const EVP_MD *evpmd; | |
82 | static int remove_links = 1; | |
83 | static int verbose = 0; | |
84 | static BUCKET *hash_table[257]; | |
85 | ||
86 | static const char *suffixes[] = { "", "r" }; | |
87 | static const char *extensions[] = { "pem", "crt", "cer", "crl" }; | |
88 | ||
89 | ||
90 | static void bit_set(unsigned char *set, unsigned int bit) | |
91 | { | |
92 | set[bit >> 3] |= 1 << (bit & 0x7); | |
93 | } | |
94 | ||
95 | static int bit_isset(unsigned char *set, unsigned int bit) | |
96 | { | |
97 | return set[bit >> 3] & (1 << (bit & 0x7)); | |
98 | } | |
99 | ||
100 | ||
ce249fac RS |
101 | /* |
102 | * Process an entry; return number of errors. | |
103 | */ | |
104 | static int add_entry(enum Type type, unsigned int hash, const char *filename, | |
8f6f1441 TT |
105 | const unsigned char *digest, int need_symlink, |
106 | unsigned short old_id) | |
107 | { | |
108 | static BUCKET nilbucket; | |
109 | static HENTRY nilhentry; | |
110 | BUCKET *bp; | |
111 | HENTRY *ep, *found = NULL; | |
112 | unsigned int ndx = (type + hash) % OSSL_NELEM(hash_table); | |
113 | ||
114 | for (bp = hash_table[ndx]; bp; bp = bp->next) | |
115 | if (bp->type == type && bp->hash == hash) | |
116 | break; | |
117 | if (bp == NULL) { | |
118 | bp = app_malloc(sizeof(*bp), "hash bucket"); | |
119 | *bp = nilbucket; | |
120 | bp->next = hash_table[ndx]; | |
121 | bp->type = type; | |
122 | bp->hash = hash; | |
123 | hash_table[ndx] = bp; | |
124 | } | |
125 | ||
126 | for (ep = bp->first_entry; ep; ep = ep->next) { | |
127 | if (digest && memcmp(digest, ep->digest, evpmdsize) == 0) { | |
128 | BIO_printf(bio_err, | |
e6a833cb RL |
129 | "%s: warning: skipping duplicate %s in %s\n", |
130 | opt_getprog(), | |
f22ff0eb | 131 | type == TYPE_CERT ? "certificate" : "CRL", filename); |
e6a833cb | 132 | return 0; |
8f6f1441 TT |
133 | } |
134 | if (strcmp(filename, ep->filename) == 0) { | |
135 | found = ep; | |
136 | if (digest == NULL) | |
137 | break; | |
138 | } | |
139 | } | |
140 | ep = found; | |
141 | if (ep == NULL) { | |
ce249fac RS |
142 | if (bp->num_needed >= MAX_COLLISIONS) { |
143 | BIO_printf(bio_err, | |
e6a833cb | 144 | "%s: error: hash table overflow for %s\n", |
ce249fac RS |
145 | opt_getprog(), filename); |
146 | return 1; | |
147 | } | |
8f6f1441 TT |
148 | ep = app_malloc(sizeof(*ep), "collision bucket"); |
149 | *ep = nilhentry; | |
150 | ep->old_id = ~0; | |
7644a9ae | 151 | ep->filename = OPENSSL_strdup(filename); |
8f6f1441 TT |
152 | if (bp->last_entry) |
153 | bp->last_entry->next = ep; | |
154 | if (bp->first_entry == NULL) | |
155 | bp->first_entry = ep; | |
156 | bp->last_entry = ep; | |
157 | } | |
158 | ||
159 | if (old_id < ep->old_id) | |
160 | ep->old_id = old_id; | |
161 | if (need_symlink && !ep->need_symlink) { | |
162 | ep->need_symlink = 1; | |
163 | bp->num_needed++; | |
164 | memcpy(ep->digest, digest, evpmdsize); | |
165 | } | |
ce249fac | 166 | return 0; |
8f6f1441 TT |
167 | } |
168 | ||
ce249fac RS |
169 | /* |
170 | * Check if a symlink goes to the right spot; return 0 if okay. | |
171 | * This can be -1 if bad filename, or an error count. | |
172 | */ | |
8f6f1441 TT |
173 | static int handle_symlink(const char *filename, const char *fullpath) |
174 | { | |
175 | unsigned int hash = 0; | |
176 | int i, type, id; | |
177 | unsigned char ch; | |
e7a68985 | 178 | char linktarget[PATH_MAX], *endptr; |
6616429d | 179 | ossl_ssize_t n; |
8f6f1441 TT |
180 | |
181 | for (i = 0; i < 8; i++) { | |
182 | ch = filename[i]; | |
183 | if (!isxdigit(ch)) | |
184 | return -1; | |
185 | hash <<= 4; | |
14f051a0 | 186 | hash += OPENSSL_hexchar2int(ch); |
8f6f1441 TT |
187 | } |
188 | if (filename[i++] != '.') | |
189 | return -1; | |
ee8f7858 DSH |
190 | for (type = OSSL_NELEM(suffixes) - 1; type > 0; type--) { |
191 | const char *suffix = suffixes[type]; | |
192 | if (strncasecmp(suffix, &filename[i], strlen(suffix)) == 0) | |
8f6f1441 | 193 | break; |
ee8f7858 | 194 | } |
8f6f1441 TT |
195 | i += strlen(suffixes[type]); |
196 | ||
197 | id = strtoul(&filename[i], &endptr, 10); | |
198 | if (*endptr != '\0') | |
199 | return -1; | |
200 | ||
201 | n = readlink(fullpath, linktarget, sizeof(linktarget)); | |
202 | if (n < 0 || n >= (int)sizeof(linktarget)) | |
203 | return -1; | |
204 | linktarget[n] = 0; | |
205 | ||
ce249fac | 206 | return add_entry(type, hash, linktarget, NULL, 0, id); |
8f6f1441 TT |
207 | } |
208 | ||
ce249fac RS |
209 | /* |
210 | * process a file, return number of errors. | |
211 | */ | |
8f6f1441 TT |
212 | static int do_file(const char *filename, const char *fullpath, enum Hash h) |
213 | { | |
ce249fac | 214 | STACK_OF (X509_INFO) *inf = NULL; |
8f6f1441 TT |
215 | X509_INFO *x; |
216 | X509_NAME *name = NULL; | |
217 | BIO *b; | |
218 | const char *ext; | |
219 | unsigned char digest[EVP_MAX_MD_SIZE]; | |
8c82de99 BL |
220 | int type, errs = 0; |
221 | size_t i; | |
8f6f1441 | 222 | |
ce249fac | 223 | /* Does it end with a recognized extension? */ |
8f6f1441 | 224 | if ((ext = strrchr(filename, '.')) == NULL) |
ce249fac | 225 | goto end; |
8c82de99 | 226 | for (i = 0; i < OSSL_NELEM(extensions); i++) { |
8f6f1441 TT |
227 | if (strcasecmp(extensions[i], ext + 1) == 0) |
228 | break; | |
229 | } | |
8c82de99 | 230 | if (i >= OSSL_NELEM(extensions)) |
ce249fac | 231 | goto end; |
8f6f1441 | 232 | |
ce249fac RS |
233 | /* Does it have X.509 data in it? */ |
234 | if ((b = BIO_new_file(fullpath, "r")) == NULL) { | |
e6a833cb | 235 | BIO_printf(bio_err, "%s: error: skipping %s, cannot open file\n", |
ce249fac RS |
236 | opt_getprog(), filename); |
237 | errs++; | |
238 | goto end; | |
239 | } | |
8f6f1441 TT |
240 | inf = PEM_X509_INFO_read_bio(b, NULL, NULL, NULL); |
241 | BIO_free(b); | |
242 | if (inf == NULL) | |
ce249fac | 243 | goto end; |
8f6f1441 TT |
244 | |
245 | if (sk_X509_INFO_num(inf) != 1) { | |
246 | BIO_printf(bio_err, | |
e6a833cb | 247 | "%s: warning: skipping %s," |
8f6f1441 TT |
248 | "it does not contain exactly one certificate or CRL\n", |
249 | opt_getprog(), filename); | |
ce249fac | 250 | /* This is not an error. */ |
8f6f1441 TT |
251 | goto end; |
252 | } | |
253 | x = sk_X509_INFO_value(inf, 0); | |
2234212c | 254 | if (x->x509 != NULL) { |
8f6f1441 TT |
255 | type = TYPE_CERT; |
256 | name = X509_get_subject_name(x->x509); | |
257 | X509_digest(x->x509, evpmd, digest, NULL); | |
2234212c | 258 | } else if (x->crl != NULL) { |
8f6f1441 TT |
259 | type = TYPE_CRL; |
260 | name = X509_CRL_get_issuer(x->crl); | |
261 | X509_CRL_digest(x->crl, evpmd, digest, NULL); | |
8c82de99 BL |
262 | } else { |
263 | ++errs; | |
264 | goto end; | |
8f6f1441 | 265 | } |
2234212c | 266 | if (name != NULL) { |
8f6f1441 | 267 | if ((h == HASH_NEW) || (h == HASH_BOTH)) |
ce249fac | 268 | errs += add_entry(type, X509_NAME_hash(name), filename, digest, 1, ~0); |
8f6f1441 | 269 | if ((h == HASH_OLD) || (h == HASH_BOTH)) |
ce249fac | 270 | errs += add_entry(type, X509_NAME_hash_old(name), filename, digest, 1, ~0); |
8f6f1441 TT |
271 | } |
272 | ||
273 | end: | |
274 | sk_X509_INFO_pop_free(inf, X509_INFO_free); | |
ce249fac | 275 | return errs; |
8f6f1441 TT |
276 | } |
277 | ||
b1ffe8db RS |
278 | static void str_free(char *s) |
279 | { | |
280 | OPENSSL_free(s); | |
281 | } | |
282 | ||
5c80e2af RL |
283 | static int ends_with_dirsep(const char *path) |
284 | { | |
285 | if (*path != '\0') | |
286 | path += strlen(path) - 1; | |
46958a04 | 287 | # if defined __VMS |
5c80e2af RL |
288 | if (*path == ']' || *path == '>' || *path == ':') |
289 | return 1; | |
46958a04 | 290 | # elif defined _WIN32 |
5c80e2af RL |
291 | if (*path == '\\') |
292 | return 1; | |
293 | # endif | |
294 | return *path == '/'; | |
295 | } | |
296 | ||
ce249fac RS |
297 | /* |
298 | * Process a directory; return number of errors found. | |
299 | */ | |
8f6f1441 TT |
300 | static int do_dir(const char *dirname, enum Hash h) |
301 | { | |
302 | BUCKET *bp, *nextbp; | |
303 | HENTRY *ep, *nextep; | |
304 | OPENSSL_DIR_CTX *d = NULL; | |
305 | struct stat st; | |
306 | unsigned char idmask[MAX_COLLISIONS / 8]; | |
b1ffe8db | 307 | int n, numfiles, nextid, buflen, errs = 0; |
8c82de99 | 308 | size_t i; |
8f6f1441 TT |
309 | const char *pathsep; |
310 | const char *filename; | |
02a7e0a9 | 311 | char *buf, *copy = NULL; |
b1ffe8db | 312 | STACK_OF(OPENSSL_STRING) *files = NULL; |
8f6f1441 | 313 | |
ff2f6bb0 RS |
314 | if (app_access(dirname, W_OK) < 0) { |
315 | BIO_printf(bio_err, "Skipping %s, can't write\n", dirname); | |
4c7103a5 | 316 | return 1; |
ff2f6bb0 | 317 | } |
8f6f1441 | 318 | buflen = strlen(dirname); |
5c80e2af | 319 | pathsep = (buflen && !ends_with_dirsep(dirname)) ? "/": ""; |
c9c84a13 AG |
320 | buflen += NAME_MAX + 1 + 1; |
321 | buf = app_malloc(buflen, "filename buffer"); | |
8f6f1441 TT |
322 | |
323 | if (verbose) | |
324 | BIO_printf(bio_out, "Doing %s\n", dirname); | |
325 | ||
b1ffe8db RS |
326 | if ((files = sk_OPENSSL_STRING_new_null()) == NULL) { |
327 | BIO_printf(bio_err, "Skipping %s, out of memory\n", dirname); | |
02a7e0a9 TS |
328 | errs = 1; |
329 | goto err; | |
b1ffe8db | 330 | } |
8f6f1441 | 331 | while ((filename = OPENSSL_DIR_read(&d, dirname)) != NULL) { |
02a7e0a9 | 332 | if ((copy = OPENSSL_strdup(filename)) == NULL |
b1ffe8db | 333 | || sk_OPENSSL_STRING_push(files, copy) == 0) { |
02a7e0a9 | 334 | OPENSSL_free(copy); |
b1ffe8db | 335 | BIO_puts(bio_err, "out of memory\n"); |
02a7e0a9 TS |
336 | errs = 1; |
337 | goto err; | |
b1ffe8db RS |
338 | } |
339 | } | |
340 | OPENSSL_DIR_end(&d); | |
341 | sk_OPENSSL_STRING_sort(files); | |
342 | ||
343 | numfiles = sk_OPENSSL_STRING_num(files); | |
344 | for (n = 0; n < numfiles; ++n) { | |
345 | filename = sk_OPENSSL_STRING_value(files, n); | |
c41048ff RS |
346 | if (BIO_snprintf(buf, buflen, "%s%s%s", |
347 | dirname, pathsep, filename) >= buflen) | |
8f6f1441 TT |
348 | continue; |
349 | if (lstat(buf, &st) < 0) | |
350 | continue; | |
351 | if (S_ISLNK(st.st_mode) && handle_symlink(filename, buf) == 0) | |
352 | continue; | |
ce249fac | 353 | errs += do_file(filename, buf, h); |
8f6f1441 | 354 | } |
8f6f1441 | 355 | |
8c82de99 | 356 | for (i = 0; i < OSSL_NELEM(hash_table); i++) { |
8f6f1441 TT |
357 | for (bp = hash_table[i]; bp; bp = nextbp) { |
358 | nextbp = bp->next; | |
359 | nextid = 0; | |
360 | memset(idmask, 0, (bp->num_needed + 7) / 8); | |
361 | for (ep = bp->first_entry; ep; ep = ep->next) | |
362 | if (ep->old_id < bp->num_needed) | |
363 | bit_set(idmask, ep->old_id); | |
364 | ||
365 | for (ep = bp->first_entry; ep; ep = nextep) { | |
366 | nextep = ep->next; | |
367 | if (ep->old_id < bp->num_needed) { | |
368 | /* Link exists, and is used as-is */ | |
c41048ff RS |
369 | BIO_snprintf(buf, buflen, "%08x.%s%d", bp->hash, |
370 | suffixes[bp->type], ep->old_id); | |
8f6f1441 TT |
371 | if (verbose) |
372 | BIO_printf(bio_out, "link %s -> %s\n", | |
373 | ep->filename, buf); | |
374 | } else if (ep->need_symlink) { | |
375 | /* New link needed (it may replace something) */ | |
376 | while (bit_isset(idmask, nextid)) | |
377 | nextid++; | |
378 | ||
c41048ff RS |
379 | BIO_snprintf(buf, buflen, "%s%s%n%08x.%s%d", |
380 | dirname, pathsep, &n, bp->hash, | |
381 | suffixes[bp->type], nextid); | |
8f6f1441 TT |
382 | if (verbose) |
383 | BIO_printf(bio_out, "link %s -> %s\n", | |
384 | ep->filename, &buf[n]); | |
ce249fac | 385 | if (unlink(buf) < 0 && errno != ENOENT) { |
8f6f1441 TT |
386 | BIO_printf(bio_err, |
387 | "%s: Can't unlink %s, %s\n", | |
388 | opt_getprog(), buf, strerror(errno)); | |
ce249fac RS |
389 | errs++; |
390 | } | |
391 | if (symlink(ep->filename, buf) < 0) { | |
8f6f1441 TT |
392 | BIO_printf(bio_err, |
393 | "%s: Can't symlink %s, %s\n", | |
394 | opt_getprog(), ep->filename, | |
395 | strerror(errno)); | |
ce249fac RS |
396 | errs++; |
397 | } | |
3770b877 | 398 | bit_set(idmask, nextid); |
8f6f1441 TT |
399 | } else if (remove_links) { |
400 | /* Link to be deleted */ | |
c41048ff RS |
401 | BIO_snprintf(buf, buflen, "%s%s%n%08x.%s%d", |
402 | dirname, pathsep, &n, bp->hash, | |
403 | suffixes[bp->type], ep->old_id); | |
8f6f1441 TT |
404 | if (verbose) |
405 | BIO_printf(bio_out, "unlink %s\n", | |
406 | &buf[n]); | |
ce249fac | 407 | if (unlink(buf) < 0 && errno != ENOENT) { |
8f6f1441 TT |
408 | BIO_printf(bio_err, |
409 | "%s: Can't unlink %s, %s\n", | |
410 | opt_getprog(), buf, strerror(errno)); | |
ce249fac RS |
411 | errs++; |
412 | } | |
8f6f1441 TT |
413 | } |
414 | OPENSSL_free(ep->filename); | |
415 | OPENSSL_free(ep); | |
416 | } | |
417 | OPENSSL_free(bp); | |
418 | } | |
419 | hash_table[i] = NULL; | |
420 | } | |
8f6f1441 | 421 | |
02a7e0a9 TS |
422 | err: |
423 | sk_OPENSSL_STRING_pop_free(files, str_free); | |
8f6f1441 | 424 | OPENSSL_free(buf); |
ce249fac | 425 | return errs; |
8f6f1441 TT |
426 | } |
427 | ||
428 | typedef enum OPTION_choice { | |
429 | OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, | |
430 | OPT_COMPAT, OPT_OLD, OPT_N, OPT_VERBOSE | |
431 | } OPTION_CHOICE; | |
432 | ||
44c83ebd | 433 | const OPTIONS rehash_options[] = { |
8f6f1441 TT |
434 | {OPT_HELP_STR, 1, '-', "Usage: %s [options] [cert-directory...]\n"}, |
435 | {OPT_HELP_STR, 1, '-', "Valid options are:\n"}, | |
436 | {"help", OPT_HELP, '-', "Display this summary"}, | |
7d959c35 | 437 | {"h", OPT_HELP, '-', "Display this summary"}, |
8f6f1441 TT |
438 | {"compat", OPT_COMPAT, '-', "Create both new- and old-style hash links"}, |
439 | {"old", OPT_OLD, '-', "Use old-style hash to generate links"}, | |
440 | {"n", OPT_N, '-', "Do not remove existing links"}, | |
441 | {"v", OPT_VERBOSE, '-', "Verbose output"}, | |
442 | {NULL} | |
443 | }; | |
444 | ||
445 | ||
446 | int rehash_main(int argc, char **argv) | |
447 | { | |
448 | const char *env, *prog; | |
449 | char *e, *m; | |
ce249fac | 450 | int errs = 0; |
8f6f1441 TT |
451 | OPTION_CHOICE o; |
452 | enum Hash h = HASH_NEW; | |
453 | ||
454 | prog = opt_init(argc, argv, rehash_options); | |
455 | while ((o = opt_next()) != OPT_EOF) { | |
456 | switch (o) { | |
457 | case OPT_EOF: | |
458 | case OPT_ERR: | |
459 | BIO_printf(bio_err, "%s: Use -help for summary.\n", prog); | |
460 | goto end; | |
461 | case OPT_HELP: | |
462 | opt_help(rehash_options); | |
463 | goto end; | |
464 | case OPT_COMPAT: | |
465 | h = HASH_BOTH; | |
466 | break; | |
467 | case OPT_OLD: | |
468 | h = HASH_OLD; | |
469 | break; | |
470 | case OPT_N: | |
471 | remove_links = 0; | |
472 | break; | |
473 | case OPT_VERBOSE: | |
474 | verbose = 1; | |
475 | break; | |
476 | } | |
477 | } | |
478 | argc = opt_num_rest(); | |
479 | argv = opt_rest(); | |
480 | ||
481 | evpmd = EVP_sha1(); | |
482 | evpmdsize = EVP_MD_size(evpmd); | |
483 | ||
2234212c PY |
484 | if (*argv != NULL) { |
485 | while (*argv != NULL) | |
ce249fac | 486 | errs += do_dir(*argv++, h); |
362ff3c3 RL |
487 | } else if ((env = getenv(X509_get_default_cert_dir_env())) != NULL) { |
488 | char lsc[2] = { LIST_SEPARATOR_CHAR, '\0' }; | |
7644a9ae | 489 | m = OPENSSL_strdup(env); |
362ff3c3 | 490 | for (e = strtok(m, lsc); e != NULL; e = strtok(NULL, lsc)) |
ce249fac | 491 | errs += do_dir(e, h); |
8f6f1441 TT |
492 | OPENSSL_free(m); |
493 | } else { | |
362ff3c3 | 494 | errs += do_dir(X509_get_default_cert_dir(), h); |
8f6f1441 TT |
495 | } |
496 | ||
497 | end: | |
ce249fac | 498 | return errs; |
8f6f1441 TT |
499 | } |
500 | ||
501 | #else | |
44c83ebd | 502 | const OPTIONS rehash_options[] = { |
62fdf4ee RS |
503 | {NULL} |
504 | }; | |
8f6f1441 TT |
505 | |
506 | int rehash_main(int argc, char **argv) | |
507 | { | |
9e0da060 | 508 | BIO_printf(bio_err, "Not available; use c_rehash script\n"); |
208fb891 | 509 | return 1; |
8f6f1441 TT |
510 | } |
511 | ||
568b8020 | 512 | #endif /* defined(OPENSSL_SYS_UNIX) || defined(__APPLE__) */ |