/src/openssl/crypto/cversion.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 1995-2016 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 | | |
10 | | #include "internal/cryptlib.h" |
11 | | #include "internal/common.h" |
12 | | |
13 | | #include "buildinf.h" |
14 | | |
15 | | unsigned long OpenSSL_version_num(void) |
16 | 0 | { |
17 | 0 | return OPENSSL_VERSION_NUMBER; |
18 | 0 | } |
19 | | |
20 | | unsigned int OPENSSL_version_major(void) |
21 | 0 | { |
22 | 0 | return OPENSSL_VERSION_MAJOR; |
23 | 0 | } |
24 | | |
25 | | unsigned int OPENSSL_version_minor(void) |
26 | 0 | { |
27 | 0 | return OPENSSL_VERSION_MINOR; |
28 | 0 | } |
29 | | |
30 | | unsigned int OPENSSL_version_patch(void) |
31 | 0 | { |
32 | 0 | return OPENSSL_VERSION_PATCH; |
33 | 0 | } |
34 | | |
35 | | const char *OPENSSL_version_pre_release(void) |
36 | 0 | { |
37 | 0 | return OPENSSL_VERSION_PRE_RELEASE; |
38 | 0 | } |
39 | | |
40 | | const char *OPENSSL_version_build_metadata(void) |
41 | 0 | { |
42 | 0 | return OPENSSL_VERSION_BUILD_METADATA; |
43 | 0 | } |
44 | | |
45 | | extern char ossl_cpu_info_str[]; |
46 | | |
47 | | const char *OpenSSL_version(int t) |
48 | 0 | { |
49 | 0 | switch (t) { |
50 | 0 | case OPENSSL_VERSION: |
51 | 0 | return OPENSSL_VERSION_TEXT; |
52 | 0 | case OPENSSL_VERSION_STRING: |
53 | 0 | return OPENSSL_VERSION_STR; |
54 | 0 | case OPENSSL_FULL_VERSION_STRING: |
55 | 0 | return OPENSSL_FULL_VERSION_STR; |
56 | 0 | case OPENSSL_BUILT_ON: |
57 | 0 | return DATE; |
58 | 0 | case OPENSSL_CFLAGS: |
59 | 0 | return compiler_flags; |
60 | 0 | case OPENSSL_PLATFORM: |
61 | 0 | return PLATFORM; |
62 | 0 | case OPENSSL_DIR: |
63 | 0 | return ossl_get_openssldir(); |
64 | 0 | case OPENSSL_ENGINES_DIR: |
65 | 0 | return ossl_get_enginesdir(); |
66 | 0 | case OPENSSL_MODULES_DIR: |
67 | 0 | return ossl_get_modulesdir(); |
68 | 0 | case OPENSSL_CPU_INFO: |
69 | 0 | if (OPENSSL_info(OPENSSL_INFO_CPU_SETTINGS) != NULL) |
70 | 0 | return ossl_cpu_info_str; |
71 | 0 | else |
72 | 0 | return "CPUINFO: N/A"; |
73 | 0 | case OPENSSL_WINCTX: |
74 | 0 | return ossl_get_wininstallcontext(); |
75 | 0 | } |
76 | 0 | return "not available"; |
77 | 0 | } |