├── Specifications ├── iPhone Simulator PackageTypes.xcspec ├── iPhone Simulator PackageTypes.xcspec.iOSOpenDev ├── iPhone Simulator ProductTypes.xcspec ├── iPhone Simulator ProductTypes.xcspec.iOSOpenDev ├── iPhoneOSPackageTypes.xcspec ├── iPhoneOSPackageTypes.xcspec.iOSOpenDev ├── iPhoneOSProductTypes.xcspec └── iPhoneOSProductTypes.xcspec.iOSOpenDev ├── make.sh └── openssl ├── aes.h ├── applink.c ├── asn1.h ├── asn1_mac.h ├── asn1t.h ├── bio.h ├── blowfish.h ├── bn.h ├── buffer.h ├── cast.h ├── comp.h ├── conf.h ├── conf_api.h ├── crypto.h ├── des.h ├── des_old.h ├── dh.h ├── dsa.h ├── dso.h ├── dtls1.h ├── e_os2.h ├── ebcdic.h ├── ec.h ├── ecdh.h ├── ecdsa.h ├── engine.h ├── err.h ├── evp.h ├── hmac.h ├── idea.h ├── krb5_asn.h ├── kssl.h ├── lhash.h ├── md2.h ├── md4.h ├── md5.h ├── obj_mac.h ├── objects.h ├── ocsp.h ├── opensslconf.h ├── opensslv.h ├── ossl_typ.h ├── pem.h ├── pem2.h ├── pkcs12.h ├── pkcs7.h ├── pq_compat.h ├── pqueue.h ├── rand.h ├── rc2.h ├── rc4.h ├── ripemd.h ├── rsa.h ├── safestack.h ├── sha.h ├── ssl.h ├── ssl2.h ├── ssl23.h ├── ssl3.h ├── stack.h ├── store.h ├── symhacks.h ├── tls1.h ├── tmdiff.h ├── txt_db.h ├── ui.h ├── ui_compat.h ├── x509.h ├── x509_vfy.h └── x509v3.h /Specifications/iPhone Simulator PackageTypes.xcspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LengYi/iosOpenDev/2cd52ca328762c8f2aa6b2a6fedbe5da79e2d8cf/Specifications/iPhone Simulator PackageTypes.xcspec -------------------------------------------------------------------------------- /Specifications/iPhone Simulator PackageTypes.xcspec.iOSOpenDev: -------------------------------------------------------------------------------- 1 | /** 2 | iPhone Simulator PackageTypes.xcspec 3 | 4 | Copyright (c) 1999-2008 Apple Inc. All rights reserved. 5 | 6 | Package type specifications for iPhone Simulator. 7 | */ 8 | ( 9 | // Application wrapper 10 | { Type = PackageType; 11 | Identifier = com.apple.package-type.wrapper.application; 12 | BasedOn = com.apple.package-type.wrapper; 13 | Name = "Application Wrapper"; 14 | Description = "Application Wrapper"; 15 | DefaultBuildSettings = { 16 | GENERATE_PKGINFO_FILE = YES; 17 | }; 18 | ProductReference = { 19 | FileType = wrapper.application; 20 | Name = "$(WRAPPER_NAME)"; 21 | IsLaunchable = YES; 22 | }; 23 | }, 24 | 25 | // CFBundle wrapper 26 | { Type = PackageType; 27 | Identifier = com.apple.package-type.wrapper; 28 | Name = "Wrapper"; 29 | Description = "Wrapper"; 30 | DefaultBuildSettings = { 31 | WRAPPER_PREFIX = ""; 32 | WRAPPER_SUFFIX = ".bundle"; 33 | WRAPPER_NAME = "$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)"; 34 | CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)"; // shallow 35 | SHALLOW_BUNDLE = YES; 36 | EXECUTABLE_PREFIX = ""; 37 | EXECUTABLE_SUFFIX = ""; 38 | EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; 39 | EXECUTABLE_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 40 | EXECUTABLE_PATH = "$(EXECUTABLE_FOLDER_PATH)/$(EXECUTABLE_NAME)"; 41 | INFOPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/Info.plist"; 42 | INFOSTRINGS_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)/InfoPlist.strings"; 43 | PKGINFO_PATH = "$(CONTENTS_FOLDER_PATH)/PkgInfo"; 44 | PBDEVELOPMENTPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/pbdevelopment.plist"; 45 | VERSIONPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/version.plist"; 46 | PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; 47 | PRIVATE_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PrivateHeaders"; 48 | EXECUTABLES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Executables"; 49 | FRAMEWORKS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Frameworks"; 50 | SHARED_FRAMEWORKS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/SharedFrameworks"; 51 | SHARED_SUPPORT_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/SharedSupport"; 52 | UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 53 | LOCALIZED_RESOURCES_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/$(DEVELOPMENT_LANGUAGE).lproj"; 54 | DOCUMENTATION_FOLDER_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)/Documentation"; 55 | PLUGINS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PlugIns"; 56 | SCRIPTS_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Scripts"; 57 | JAVA_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Java"; 58 | }; 59 | ProductReference = { 60 | FileType = wrapper.cfbundle; 61 | Name = "$(WRAPPER_NAME)"; 62 | IsLaunchable = NO; 63 | }; 64 | }, 65 | 66 | // Framework wrapper 67 | { Type = PackageType; 68 | Identifier = com.apple.package-type.wrapper.framework; 69 | Name = "Framework Wrapper"; 70 | Description = "Framework wrapper"; 71 | DefaultBuildSettings = { 72 | WRAPPER_PREFIX = ""; 73 | WRAPPER_SUFFIX = ".framework"; 74 | WRAPPER_NAME = "$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)"; 75 | VERSIONS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions"; 76 | CONTENTS_FOLDER_PATH = "$(VERSIONS_FOLDER_PATH)/$(FRAMEWORK_VERSION)"; 77 | CURRENT_VERSION = "Current"; 78 | EXECUTABLE_PREFIX = ""; 79 | EXECUTABLE_SUFFIX = ""; 80 | EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; 81 | EXECUTABLE_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 82 | EXECUTABLE_PATH = "$(EXECUTABLE_FOLDER_PATH)/$(EXECUTABLE_NAME)"; 83 | INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; 84 | INFOPLISTSTRINGS_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)/InfoPlist.strings"; 85 | PKGINFO_PATH = "$(WRAPPER_NAME)/PkgInfo"; 86 | PBDEVELOPMENTPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/pbdevelopment.plist"; 87 | VERSIONPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/version.plist"; 88 | PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; 89 | PRIVATE_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PrivateHeaders"; 90 | EXECUTABLES_FOLDER_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)"; // Not the same as EXECUTABLE_FOLDER_PATH 91 | FRAMEWORKS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Frameworks"; 92 | SHARED_FRAMEWORKS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/SharedFrameworks"; 93 | SHARED_SUPPORT_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)"; 94 | UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; 95 | LOCALIZED_RESOURCES_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/$(DEVELOPMENT_LANGUAGE).lproj"; 96 | DOCUMENTATION_FOLDER_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)/Documentation"; 97 | PLUGINS_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)"; 98 | SCRIPTS_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Scripts"; 99 | JAVA_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Java"; 100 | CODESIGNING_FOLDER_PATH = "$(TARGET_BUILD_DIR)/$(CONTENTS_FOLDER_PATH)"; 101 | }; 102 | ProductReference = { 103 | FileType = wrapper.framework; 104 | Name = "$(WRAPPER_NAME)"; 105 | IsLaunchable = NO; 106 | }; 107 | }, 108 | 109 | // Static library ('ar' archive containing .o files) 110 | { Type = PackageType; 111 | Identifier = com.apple.package-type.static-library; 112 | Name = "Mach-O Static Library"; 113 | Description = "Mach-O static library"; 114 | DefaultBuildSettings = { 115 | EXECUTABLE_PREFIX = "lib"; 116 | EXECUTABLE_SUFFIX = ".a"; 117 | EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; 118 | EXECUTABLE_PATH = "$(EXECUTABLE_NAME)"; 119 | }; 120 | ProductReference = { 121 | FileType = archive.ar; 122 | Name = "$(EXECUTABLE_NAME)"; 123 | IsLaunchable = NO; 124 | }; 125 | }, 126 | 127 | // Mach-O dynamic library 128 | { Type = PackageType; 129 | Identifier = com.apple.package-type.mach-o-dylib; 130 | Name = "Mach-O Dynamic Library"; 131 | Description = "Mach-O dynamic library"; 132 | DefaultBuildSettings = { 133 | EXECUTABLE_PREFIX = ""; 134 | EXECUTABLE_SUFFIX = ""; 135 | EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; 136 | EXECUTABLE_PATH = "$(EXECUTABLE_NAME)"; 137 | }; 138 | ProductReference = { 139 | FileType = compiled.mach-o.dylib; 140 | Name = "$(EXECUTABLE_NAME)"; 141 | IsLaunchable = NO; 142 | }; 143 | }, 144 | 145 | 146 | ) 147 | 148 | -------------------------------------------------------------------------------- /Specifications/iPhone Simulator ProductTypes.xcspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LengYi/iosOpenDev/2cd52ca328762c8f2aa6b2a6fedbe5da79e2d8cf/Specifications/iPhone Simulator ProductTypes.xcspec -------------------------------------------------------------------------------- /Specifications/iPhone Simulator ProductTypes.xcspec.iOSOpenDev: -------------------------------------------------------------------------------- 1 | /** 2 | iPhone Simulator ProductTypes.xcspec 3 | 4 | Copyright (c) 1999-2008 Apple Inc. All rights reserved. 5 | 6 | Product type specifications for iPhone Simulator. 7 | */ 8 | ( 9 | // Application 10 | { Type = ProductType; 11 | Identifier = com.apple.product-type.application; 12 | BasedOn = com.apple.product-type.bundle; 13 | Class = PBXApplicationProductType; 14 | Name = "Application"; 15 | Description = "Application"; 16 | IconNamePrefix = "TargetApp"; 17 | DefaultTargetName = "Application"; 18 | SupportsZeroLink = YES; 19 | DefaultBuildProperties = { 20 | MACH_O_TYPE = "mh_execute"; 21 | GCC_DYNAMIC_NO_PIC = NO; 22 | GCC_SYMBOLS_PRIVATE_EXTERN = YES; 23 | GCC_INLINES_ARE_PRIVATE_EXTERN = YES; 24 | WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)"; 25 | WRAPPER_EXTENSION = "app"; 26 | INSTALL_PATH = "$(LOCAL_APPS_DIR)"; 27 | STRIP_STYLE = "all"; 28 | }; 29 | PackageTypes = ( 30 | com.apple.package-type.wrapper.application 31 | ); 32 | }, 33 | 34 | // Bundle 35 | { Type = ProductType; 36 | Identifier = com.apple.product-type.bundle; 37 | Class = PBXBundleProductType; 38 | Name = "Bundle"; 39 | Description = "Generic bundle"; 40 | IconNamePrefix = "TargetPlugin"; 41 | DefaultTargetName = "Bundle"; 42 | DefaultBuildProperties = { 43 | FULL_PRODUCT_NAME = "$(WRAPPER_NAME)"; 44 | MACH_O_TYPE = "mh_bundle"; 45 | WRAPPER_PREFIX = ""; 46 | WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)"; 47 | WRAPPER_EXTENSION = "bundle"; 48 | WRAPPER_NAME = "$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)"; 49 | FRAMEWORK_FLAG_PREFIX = "-framework"; 50 | LIBRARY_FLAG_PREFIX = "-l"; 51 | LIBRARY_FLAG_NOSPACE = YES; 52 | STRIP_STYLE = "non-global"; 53 | GCC_INLINES_ARE_PRIVATE_EXTERN = YES; 54 | }; 55 | PackageTypes = ( 56 | com.apple.package-type.wrapper 57 | ); 58 | IsWrapper = YES; 59 | HasInfoPlist = YES; 60 | HasInfoPlistStrings = YES; 61 | }, 62 | 63 | // Static library 64 | { Type = ProductType; 65 | Identifier = com.apple.product-type.library.static; 66 | Class = PBXStaticLibraryProductType; 67 | Name = "Static Library"; 68 | Description = "Static library"; 69 | IconNamePrefix = "TargetLibrary"; 70 | DefaultTargetName = "Static Library"; 71 | DefaultBuildProperties = { 72 | FULL_PRODUCT_NAME = "$(EXECUTABLE_NAME)"; 73 | MACH_O_TYPE = "staticlib"; 74 | REZ_EXECUTABLE = YES; 75 | EXECUTABLE_PREFIX = "lib"; 76 | EXECUTABLE_SUFFIX = ".$(EXECUTABLE_EXTENSION)"; 77 | EXECUTABLE_EXTENSION = "a"; 78 | PUBLIC_HEADERS_FOLDER_PATH = "/usr/local/include"; 79 | PRIVATE_HEADERS_FOLDER_PATH = "/usr/local/include"; 80 | INSTALL_PATH = "/usr/local/lib"; 81 | FRAMEWORK_FLAG_PREFIX = "-framework"; 82 | LIBRARY_FLAG_PREFIX = "-l"; 83 | LIBRARY_FLAG_NOSPACE = YES; 84 | STRIP_STYLE = "debugging"; 85 | SEPARATE_STRIP = YES; 86 | GCC_ENABLE_SYMBOL_SEPARATION = NO; 87 | }; 88 | AlwaysPerformSeparateStrip = YES; 89 | PackageTypes = ( 90 | com.apple.package-type.static-library // default 91 | ); 92 | }, 93 | 94 | // Dynamic library 95 | { Type = ProductType; 96 | Identifier = com.apple.product-type.library.dynamic; 97 | Class = PBXDynamicLibraryProductType; 98 | Name = "Dynamic Library"; 99 | Description = "Dynamic library"; 100 | IconNamePrefix = "TargetLibrary"; 101 | DefaultTargetName = "Dynamic Library"; 102 | DefaultBuildProperties = { 103 | FULL_PRODUCT_NAME = "$(EXECUTABLE_NAME)"; 104 | MACH_O_TYPE = "mh_dylib"; 105 | REZ_EXECUTABLE = YES; 106 | EXECUTABLE_SUFFIX = ".$(EXECUTABLE_EXTENSION)"; 107 | EXECUTABLE_EXTENSION = "dylib"; 108 | PUBLIC_HEADERS_FOLDER_PATH = "/usr/local/include"; 109 | PRIVATE_HEADERS_FOLDER_PATH = "/usr/local/include"; 110 | INSTALL_PATH = "/usr/local/lib"; 111 | DYLIB_INSTALL_NAME_BASE = "$(INSTALL_PATH)"; 112 | LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; 113 | DYLIB_COMPATIBILITY_VERSION = "1"; 114 | DYLIB_CURRENT_VERSION = "1"; 115 | FRAMEWORK_FLAG_PREFIX = "-framework"; 116 | LIBRARY_FLAG_PREFIX = "-l"; 117 | LIBRARY_FLAG_NOSPACE = YES; 118 | STRIP_STYLE = "debugging"; 119 | GCC_INLINES_ARE_PRIVATE_EXTERN = YES; 120 | CODE_SIGNING_ALLOWED = YES; 121 | }; 122 | PackageTypes = ( 123 | com.apple.package-type.mach-o-dylib // default 124 | ); 125 | }, 126 | 127 | // Framework 128 | { Type = ProductType; 129 | Identifier = com.apple.product-type.framework; 130 | BasedOn = com.apple.product-type.bundle; 131 | Class = PBXFrameworkProductType; 132 | Name = "Framework"; 133 | Description = "Framework"; 134 | IconNamePrefix = "TargetFramework"; 135 | DefaultTargetName = "Framework"; 136 | DefaultBuildProperties = { 137 | MACH_O_TYPE = "mh_dylib"; 138 | FRAMEWORK_VERSION = "A"; 139 | WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)"; 140 | WRAPPER_EXTENSION = "framework"; 141 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 142 | DYLIB_INSTALL_NAME_BASE = "$(INSTALL_PATH)"; 143 | LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; 144 | STRIP_STYLE = "debugging"; 145 | CODE_SIGNING_ALLOWED = YES; 146 | }; 147 | PackageTypes = ( 148 | com.apple.package-type.wrapper.framework // default 149 | ); 150 | }, 151 | 152 | // Unit Test Bundle Product 153 | { Type = ProductType; 154 | Identifier = com.apple.product-type.bundle.unit-test; 155 | BasedOn = com.apple.product-type.bundle; 156 | Name = "Unit Test Bundle"; 157 | Description = "Unit Test Bundle"; 158 | DefaultBuildProperties = { 159 | WRAPPER_EXTENSION = "xctest"; 160 | OTHER_LDFLAGS = "$(inherited) -framework XCTest"; 161 | FRAMEWORK_SEARCH_PATHS = "$(inherited) $(DEVELOPER_FRAMEWORKS_DIR)"; 162 | }; 163 | PackageTypes = ( 164 | com.apple.package-type.wrapper 165 | ); 166 | }, 167 | 168 | ) 169 | -------------------------------------------------------------------------------- /Specifications/iPhoneOSPackageTypes.xcspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LengYi/iosOpenDev/2cd52ca328762c8f2aa6b2a6fedbe5da79e2d8cf/Specifications/iPhoneOSPackageTypes.xcspec -------------------------------------------------------------------------------- /Specifications/iPhoneOSPackageTypes.xcspec.iOSOpenDev: -------------------------------------------------------------------------------- 1 | // !!! BINARY PROPERTY LIST WARNING !!! 2 | // 3 | // The pretty-printed property list below has been created 4 | // from a binary version on disk and should not be saved as 5 | // the ASCII format is a subset of the binary representation! 6 | // 7 | ( 8 | { DefaultBuildSettings = { 9 | CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)"; 10 | DOCUMENTATION_FOLDER_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)/Documentation"; 11 | EXECUTABLES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Executables"; 12 | EXECUTABLE_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 13 | EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; 14 | EXECUTABLE_PATH = "$(EXECUTABLE_FOLDER_PATH)/$(EXECUTABLE_NAME)"; 15 | EXECUTABLE_PREFIX = ""; 16 | EXECUTABLE_SUFFIX = ""; 17 | FRAMEWORKS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Frameworks"; 18 | INFOPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/Info.plist"; 19 | INFOSTRINGS_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)/InfoPlist.strings"; 20 | JAVA_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Java"; 21 | LOCALIZED_RESOURCES_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/$(DEVELOPMENT_LANGUAGE).lproj"; 22 | PBDEVELOPMENTPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/pbdevelopment.plist"; 23 | PKGINFO_PATH = "$(CONTENTS_FOLDER_PATH)/PkgInfo"; 24 | PLUGINS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PlugIns"; 25 | PRIVATE_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PrivateHeaders"; 26 | PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; 27 | SCRIPTS_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Scripts"; 28 | SHALLOW_BUNDLE = "YES"; 29 | SHARED_FRAMEWORKS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/SharedFrameworks"; 30 | SHARED_SUPPORT_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/SharedSupport"; 31 | UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 32 | VERSIONPLIST_PATH = "$(CONTENTS_FOLDER_PATH)/version.plist"; 33 | WRAPPER_NAME = "$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)"; 34 | WRAPPER_PREFIX = ""; 35 | WRAPPER_SUFFIX = ".bundle"; 36 | }; 37 | Description = "Wrapper"; 38 | Identifier = "com.apple.package-type.wrapper"; 39 | Name = "Wrapper"; 40 | ProductReference = { 41 | FileType = "wrapper.cfbundle"; 42 | IsLaunchable = "NO"; 43 | Name = "$(WRAPPER_NAME)"; 44 | }; 45 | Type = "PackageType"; 46 | }, 47 | { BasedOn = "com.apple.package-type.wrapper"; 48 | DefaultBuildSettings = { GENERATE_PKGINFO_FILE = "YES"; }; 49 | Description = "Application Wrapper"; 50 | Identifier = "com.apple.package-type.wrapper.application"; 51 | Name = "Application Wrapper"; 52 | ProductReference = { 53 | FileType = "wrapper.application"; 54 | IsLaunchable = "YES"; 55 | Name = "$(WRAPPER_NAME)"; 56 | }; 57 | Type = "PackageType"; 58 | }, 59 | { BasedOn = "com.apple.package-type.wrapper"; 60 | DefaultBuildSettings = { WRAPPER_SUFFIX = "xctest"; }; 61 | Description = "Unit Test Bundle"; 62 | Identifier = "com.apple.package-type.bundle.unit-test"; 63 | Name = "Unit Test Bundle"; 64 | ProductReference = { 65 | FileType = "wrapper.cfbundle"; 66 | IsLaunchable = "NO"; 67 | Name = "$(WRAPPER_NAME)"; 68 | }; 69 | Type = "PackageType"; 70 | }, 71 | { BasedOn = "com.apple.package-type.wrapper"; 72 | DefaultBuildSettings = { 73 | CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Contents"; 74 | DOCUMENTATION_FOLDER_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)"; 75 | EXECUTABLES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 76 | EXECUTABLE_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 77 | FRAMEWORKS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 78 | INFOPLIST_PATH = "$(WRAPPER_NAME)/ContentInfo.plist"; 79 | INFOSTRINGS_PATH = "$(LOCALIZED_RESOURCES_FOLDER_PATH)/ContentInfo.strings"; 80 | JAVA_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)"; 81 | LOCALIZED_RESOURCES_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/$(DEVELOPMENT_LANGUAGE).lproj"; 82 | PLUGINS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 83 | PRIVATE_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 84 | PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 85 | SCRIPTS_FOLDER_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)"; 86 | SHARED_FRAMEWORKS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 87 | SHARED_SUPPORT_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 88 | UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)"; 89 | WRAPPER_SUFFIX = ""; 90 | }; 91 | Description = "In-App Purchase Content"; 92 | Identifier = "com.apple.package-type.in-app-purchase-content"; 93 | Name = "In-App Purchase Content"; 94 | ProductReference = { 95 | FileType = "folder"; 96 | IsLaunchable = "NO"; 97 | Name = "$(WRAPPER_NAME)"; 98 | }; 99 | Type = "PackageType"; 100 | }, 101 | { DefaultBuildSettings = { 102 | EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; 103 | EXECUTABLE_PATH = "$(EXECUTABLE_NAME)"; 104 | EXECUTABLE_PREFIX = "lib"; 105 | EXECUTABLE_SUFFIX = ".a"; 106 | }; 107 | Description = "Mach-O static library"; 108 | Identifier = "com.apple.package-type.static-library"; 109 | Name = "Mach-O Static Library"; 110 | ProductReference = { 111 | FileType = "archive.ar"; 112 | IsLaunchable = "NO"; 113 | Name = "$(EXECUTABLE_NAME)"; 114 | }; 115 | Type = "PackageType"; 116 | }, 117 | // Mach-O dynamic library 118 | { Type = PackageType; 119 | Identifier = com.apple.package-type.mach-o-dylib; 120 | Name = "Mach-O Dynamic Library"; 121 | Description = "Mach-O dynamic library"; 122 | DefaultBuildSettings = { 123 | EXECUTABLE_PREFIX = ""; 124 | EXECUTABLE_SUFFIX = ""; 125 | EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)"; 126 | EXECUTABLE_PATH = "$(EXECUTABLE_NAME)"; 127 | }; 128 | ProductReference = { 129 | FileType = compiled.mach-o.dylib; 130 | Name = "$(EXECUTABLE_NAME)"; 131 | IsLaunchable = NO; 132 | }; 133 | }, 134 | ) 135 | -------------------------------------------------------------------------------- /Specifications/iPhoneOSProductTypes.xcspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LengYi/iosOpenDev/2cd52ca328762c8f2aa6b2a6fedbe5da79e2d8cf/Specifications/iPhoneOSProductTypes.xcspec -------------------------------------------------------------------------------- /Specifications/iPhoneOSProductTypes.xcspec.iOSOpenDev: -------------------------------------------------------------------------------- 1 | // !!! BINARY PROPERTY LIST WARNING !!! 2 | // 3 | // The pretty-printed property list below has been created 4 | // from a binary version on disk and should not be saved as 5 | // the ASCII format is a subset of the binary representation! 6 | // 7 | ( 8 | { Class = "PBXBundleProductType"; 9 | DefaultBuildProperties = { 10 | FRAMEWORK_FLAG_PREFIX = "-framework"; 11 | FULL_PRODUCT_NAME = "$(WRAPPER_NAME)"; 12 | GCC_INLINES_ARE_PRIVATE_EXTERN = "YES"; 13 | LIBRARY_FLAG_NOSPACE = "YES"; 14 | LIBRARY_FLAG_PREFIX = "-l"; 15 | MACH_O_TYPE = "mh_bundle"; 16 | STRIP_STYLE = "non-global"; 17 | WRAPPER_EXTENSION = "bundle"; 18 | WRAPPER_NAME = "$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)"; 19 | WRAPPER_PREFIX = ""; 20 | WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)"; 21 | }; 22 | DefaultTargetName = "Bundle"; 23 | Description = "Generic bundle"; 24 | HasInfoPlist = "YES"; 25 | HasInfoPlistStrings = "YES"; 26 | IconNamePrefix = "TargetPlugin"; 27 | Identifier = "com.apple.product-type.bundle"; 28 | IsWrapper = "YES"; 29 | Name = "Bundle"; 30 | PackageTypes = ( "com.apple.package-type.wrapper" ); 31 | Type = "ProductType"; 32 | }, 33 | { BasedOn = "com.apple.product-type.bundle"; 34 | Class = "PBXApplicationProductType"; 35 | DefaultBuildProperties = { 36 | CODE_SIGNING_ALLOWED = "YES"; 37 | ENTITLEMENTS_ALLOWED = "YES"; 38 | GCC_INLINES_ARE_PRIVATE_EXTERN = "YES"; 39 | GCC_SYMBOLS_PRIVATE_EXTERN = "YES"; 40 | INSTALL_PATH = "$(LOCAL_APPS_DIR)"; 41 | MACH_O_TYPE = "mh_execute"; 42 | PROVISIONING_PROFILE_REQUIRED = "YES"; 43 | RESOURCE_RULES_REQUIRED = "YES"; 44 | STRIP_STYLE = "all"; 45 | WRAPPER_EXTENSION = "app"; 46 | WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)"; 47 | }; 48 | DefaultTargetName = "Application"; 49 | Description = "Application"; 50 | IconNamePrefix = "TargetApp"; 51 | Identifier = "com.apple.product-type.application"; 52 | Name = "Application"; 53 | PackageTypes = ( "com.apple.package-type.wrapper.application" ); 54 | SupportsZeroLink = "YES"; 55 | Type = "ProductType"; 56 | Validation = { 57 | AdditionalValidationClass = "XCiPhoneOSPlatformPlugin"; 58 | Checks = { "!( $(VALIDATE_PRODUCT) == NO && $(CODE_SIGN_IDENTITY) == 'iPhone Distribution' )" = "The Validate Built Product build setting was not enabled when building for Distribution."; }; 59 | ValidationToolSpec = "com.apple.build-tools.platform.validate"; 60 | }; 61 | }, 62 | { BasedOn = "com.apple.product-type.bundle"; 63 | Class = "PBXBundleProductType"; 64 | DefaultBuildProperties = { 65 | FRAMEWORK_SEARCH_PATHS = "$(inherited) $(DEVELOPER_FRAMEWORKS_DIR)"; 66 | OTHER_LDFLAGS = "$(inherited) -framework XCTest"; 67 | WRAPPER_EXTENSION = "xctest"; 68 | }; 69 | Description = "Unit Test Bundle"; 70 | Identifier = "com.apple.product-type.bundle.unit-test"; 71 | Name = "Unit Test Bundle"; 72 | PackageTypes = ( "com.apple.package-type.bundle.unit-test" ); 73 | Type = "ProductType"; 74 | }, 75 | { Class = "PBXBundleProductType"; 76 | DefaultBuildProperties = { FULL_PRODUCT_NAME = "$(WRAPPER_NAME)"; }; 77 | Description = "In-App Purchase Content"; 78 | HasInfoPlist = "YES"; 79 | HasInfoPlistStrings = "NO"; 80 | Identifier = "com.apple.product-type.in-app-purchase-content"; 81 | IsWrapper = "YES"; 82 | Name = "In-App Purchase Content"; 83 | PackageTypes = ( "com.apple.package-type.in-app-purchase-content" ); 84 | Type = "ProductType"; 85 | }, 86 | { AlwaysPerformSeparateStrip = "YES"; 87 | Class = "PBXStaticLibraryProductType"; 88 | DefaultBuildProperties = { 89 | CODE_SIGNING_ALLOWED = "NO"; 90 | EXECUTABLE_EXTENSION = "a"; 91 | EXECUTABLE_PREFIX = "lib"; 92 | EXECUTABLE_SUFFIX = ".$(EXECUTABLE_EXTENSION)"; 93 | FRAMEWORK_FLAG_PREFIX = "-framework"; 94 | FULL_PRODUCT_NAME = "$(EXECUTABLE_NAME)"; 95 | GCC_ENABLE_SYMBOL_SEPARATION = "NO"; 96 | INSTALL_PATH = "/usr/local/lib"; 97 | LIBRARY_FLAG_NOSPACE = "YES"; 98 | LIBRARY_FLAG_PREFIX = "-l"; 99 | MACH_O_TYPE = "staticlib"; 100 | PRIVATE_HEADERS_FOLDER_PATH = "/usr/local/include"; 101 | PUBLIC_HEADERS_FOLDER_PATH = "/usr/local/include"; 102 | REZ_EXECUTABLE = "YES"; 103 | SEPARATE_STRIP = "YES"; 104 | STRIP_STYLE = "debugging"; 105 | }; 106 | DefaultTargetName = "Static Library"; 107 | Description = "Static library"; 108 | IconNamePrefix = "TargetLibrary"; 109 | Identifier = "com.apple.product-type.library.static"; 110 | Name = "Static Library"; 111 | PackageTypes = ( "com.apple.package-type.static-library" ); 112 | Type = "ProductType"; 113 | }, 114 | // Dynamic library 115 | { Type = ProductType; 116 | Identifier = com.apple.product-type.library.dynamic; 117 | Class = PBXDynamicLibraryProductType; 118 | Name = "Dynamic Library"; 119 | Description = "Dynamic library"; 120 | IconNamePrefix = "TargetLibrary"; 121 | DefaultTargetName = "Dynamic Library"; 122 | DefaultBuildProperties = { 123 | FULL_PRODUCT_NAME = "$(EXECUTABLE_NAME)"; 124 | MACH_O_TYPE = "mh_dylib"; 125 | REZ_EXECUTABLE = YES; 126 | EXECUTABLE_SUFFIX = ".$(EXECUTABLE_EXTENSION)"; 127 | EXECUTABLE_EXTENSION = "dylib"; 128 | PUBLIC_HEADERS_FOLDER_PATH = "/usr/local/include"; 129 | PRIVATE_HEADERS_FOLDER_PATH = "/usr/local/include"; 130 | INSTALL_PATH = "/usr/local/lib"; 131 | DYLIB_INSTALL_NAME_BASE = "$(INSTALL_PATH)"; 132 | LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; 133 | DYLIB_COMPATIBILITY_VERSION = "1"; 134 | DYLIB_CURRENT_VERSION = "1"; 135 | FRAMEWORK_FLAG_PREFIX = "-framework"; 136 | LIBRARY_FLAG_PREFIX = "-l"; 137 | LIBRARY_FLAG_NOSPACE = YES; 138 | STRIP_STYLE = "debugging"; 139 | GCC_INLINES_ARE_PRIVATE_EXTERN = YES; 140 | CODE_SIGNING_ALLOWED = YES; 141 | }; 142 | PackageTypes = ( 143 | com.apple.package-type.mach-o-dylib // default 144 | ); 145 | }, 146 | 147 | // Framework 148 | { Type = ProductType; 149 | Identifier = com.apple.product-type.framework; 150 | BasedOn = com.apple.product-type.bundle; 151 | Class = PBXFrameworkProductType; 152 | Name = "Framework"; 153 | Description = "Framework"; 154 | IconNamePrefix = "TargetFramework"; 155 | DefaultTargetName = "Framework"; 156 | DefaultBuildProperties = { 157 | MACH_O_TYPE = "mh_dylib"; 158 | FRAMEWORK_VERSION = "A"; 159 | WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)"; 160 | WRAPPER_EXTENSION = "framework"; 161 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 162 | DYLIB_INSTALL_NAME_BASE = "$(INSTALL_PATH)"; 163 | LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; 164 | STRIP_STYLE = "debugging"; 165 | CODE_SIGNING_ALLOWED = YES; 166 | }; 167 | PackageTypes = ( 168 | com.apple.package-type.wrapper.framework // default 169 | ); 170 | }, 171 | ) 172 | -------------------------------------------------------------------------------- /make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | shopt -s extglob 5 | 6 | if [[ $# == 0 ]]; then 7 | ios=false 8 | else 9 | ios=$1 10 | shift 11 | fi 12 | 13 | if "${ios}"; then 14 | 15 | out=ios 16 | sudo xcode-select --switch /Applications/Xcode.app 17 | flags=(cycc -- -miphoneos-version-min=2.0 -arch armv7 arm64) 18 | 19 | else 20 | 21 | out=out 22 | sudo xcode-select --switch /Applications/Xcode.app 23 | 24 | if which xcrun &>/dev/null; then 25 | flags=(xcrun -sdk macosx g++) 26 | flags+=(-mmacosx-version-min=10.4) 27 | 28 | for arch in i386 x86_64; do 29 | flags+=(-arch "${arch}") 30 | done 31 | else 32 | flags=(g++) 33 | fi 34 | 35 | fi 36 | 37 | sdk=$(xcodebuild -sdk iphoneos -version Path) 38 | 39 | flags+=(-I.) 40 | flags+=(-I"${sdk}"/usr/include/libxml2) 41 | flags+=(-Ilibplist/include) 42 | flags+=(-Ilibplist/libcnary/include) 43 | 44 | flags+=("$@") 45 | 46 | mkdir -p "${out}" 47 | os=() 48 | 49 | for c in libplist/libcnary/!(cnary).c libplist/src/*.c; do 50 | o=${c%.c}.o 51 | o="${out}"/${o##*/} 52 | os+=("${o}") 53 | if [[ "${c}" -nt "${o}" ]]; then 54 | "${flags[@]}" -c -o "${o}" -x c "${c}" 55 | fi 56 | done 57 | 58 | set -x 59 | 60 | "${flags[@]}" -c -std=c++11 -o "${out}"/ldid.o ldid.cpp 61 | "${flags[@]}" -o "${out}"/ldid "${out}"/ldid.o "${os[@]}" -x c lookup2.c -lxml2 -framework Security -lcrypto 62 | 63 | if ! "${ios}"; then 64 | ln -sf out/ldid . 65 | fi 66 | -------------------------------------------------------------------------------- /openssl/aes.h: -------------------------------------------------------------------------------- 1 | /* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ 2 | /* ==================================================================== 3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in 14 | * the documentation and/or other materials provided with the 15 | * distribution. 16 | * 17 | * 3. All advertising materials mentioning features or use of this 18 | * software must display the following acknowledgment: 19 | * "This product includes software developed by the OpenSSL Project 20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 21 | * 22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 23 | * endorse or promote products derived from this software without 24 | * prior written permission. For written permission, please contact 25 | * openssl-core@openssl.org. 26 | * 27 | * 5. Products derived from this software may not be called "OpenSSL" 28 | * nor may "OpenSSL" appear in their names without prior written 29 | * permission of the OpenSSL Project. 30 | * 31 | * 6. Redistributions of any form whatsoever must retain the following 32 | * acknowledgment: 33 | * "This product includes software developed by the OpenSSL Project 34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 35 | * 36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 47 | * OF THE POSSIBILITY OF SUCH DAMAGE. 48 | * ==================================================================== 49 | * 50 | */ 51 | 52 | #ifndef HEADER_AES_H 53 | #define HEADER_AES_H 54 | 55 | #include 56 | 57 | #ifdef OPENSSL_NO_AES 58 | #error AES is disabled. 59 | #endif 60 | 61 | #define AES_ENCRYPT 1 62 | #define AES_DECRYPT 0 63 | 64 | /* Because array size can't be a const in C, the following two are macros. 65 | Both sizes are in bytes. */ 66 | #define AES_MAXNR 14 67 | #define AES_BLOCK_SIZE 16 68 | 69 | #ifdef __cplusplus 70 | extern "C" { 71 | #endif 72 | 73 | /* This should be a hidden type, but EVP requires that the size be known */ 74 | struct aes_key_st { 75 | #ifdef AES_LONG 76 | unsigned long rd_key[4 *(AES_MAXNR + 1)]; 77 | #else 78 | unsigned int rd_key[4 *(AES_MAXNR + 1)]; 79 | #endif 80 | int rounds; 81 | }; 82 | typedef struct aes_key_st AES_KEY; 83 | 84 | const char *AES_options(void); 85 | 86 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, 87 | AES_KEY *key); 88 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, 89 | AES_KEY *key); 90 | 91 | void AES_encrypt(const unsigned char *in, unsigned char *out, 92 | const AES_KEY *key); 93 | void AES_decrypt(const unsigned char *in, unsigned char *out, 94 | const AES_KEY *key); 95 | 96 | void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, 97 | const AES_KEY *key, const int enc); 98 | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, 99 | const unsigned long length, const AES_KEY *key, 100 | unsigned char *ivec, const int enc); 101 | void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, 102 | const unsigned long length, const AES_KEY *key, 103 | unsigned char *ivec, int *num, const int enc); 104 | void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, 105 | const unsigned long length, const AES_KEY *key, 106 | unsigned char *ivec, int *num, const int enc); 107 | void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, 108 | const unsigned long length, const AES_KEY *key, 109 | unsigned char *ivec, int *num, const int enc); 110 | void AES_cfbr_encrypt_block(const unsigned char *in,unsigned char *out, 111 | const int nbits,const AES_KEY *key, 112 | unsigned char *ivec,const int enc); 113 | void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, 114 | const unsigned long length, const AES_KEY *key, 115 | unsigned char *ivec, int *num); 116 | void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, 117 | const unsigned long length, const AES_KEY *key, 118 | unsigned char ivec[AES_BLOCK_SIZE], 119 | unsigned char ecount_buf[AES_BLOCK_SIZE], 120 | unsigned int *num); 121 | 122 | /* For IGE, see also http://www.links.org/files/openssl-ige.pdf */ 123 | /* NB: the IV is _two_ blocks long */ 124 | void AES_ige_encrypt(const unsigned char *in, unsigned char *out, 125 | const unsigned long length, const AES_KEY *key, 126 | unsigned char *ivec, const int enc); 127 | /* NB: the IV is _four_ blocks long */ 128 | void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, 129 | const unsigned long length, const AES_KEY *key, 130 | const AES_KEY *key2, const unsigned char *ivec, 131 | const int enc); 132 | 133 | 134 | #ifdef __cplusplus 135 | } 136 | #endif 137 | 138 | #endif /* !HEADER_AES_H */ 139 | -------------------------------------------------------------------------------- /openssl/applink.c: -------------------------------------------------------------------------------- 1 | #define APPLINK_STDIN 1 2 | #define APPLINK_STDOUT 2 3 | #define APPLINK_STDERR 3 4 | #define APPLINK_FPRINTF 4 5 | #define APPLINK_FGETS 5 6 | #define APPLINK_FREAD 6 7 | #define APPLINK_FWRITE 7 8 | #define APPLINK_FSETMOD 8 9 | #define APPLINK_FEOF 9 10 | #define APPLINK_FCLOSE 10 /* should not be used */ 11 | 12 | #define APPLINK_FOPEN 11 /* solely for completeness */ 13 | #define APPLINK_FSEEK 12 14 | #define APPLINK_FTELL 13 15 | #define APPLINK_FFLUSH 14 16 | #define APPLINK_FERROR 15 17 | #define APPLINK_CLEARERR 16 18 | #define APPLINK_FILENO 17 /* to be used with below */ 19 | 20 | #define APPLINK_OPEN 18 /* formally can't be used, as flags can vary */ 21 | #define APPLINK_READ 19 22 | #define APPLINK_WRITE 20 23 | #define APPLINK_LSEEK 21 24 | #define APPLINK_CLOSE 22 25 | #define APPLINK_MAX 22 /* always same as last macro */ 26 | 27 | #ifndef APPMACROS_ONLY 28 | #include 29 | #include 30 | #include 31 | 32 | static void *app_stdin(void) { return stdin; } 33 | static void *app_stdout(void) { return stdout; } 34 | static void *app_stderr(void) { return stderr; } 35 | static int app_feof(FILE *fp) { return feof(fp); } 36 | static int app_ferror(FILE *fp) { return ferror(fp); } 37 | static void app_clearerr(FILE *fp) { clearerr(fp); } 38 | static int app_fileno(FILE *fp) { return _fileno(fp); } 39 | static int app_fsetmod(FILE *fp,char mod) 40 | { return _setmode (_fileno(fp),mod=='b'?_O_BINARY:_O_TEXT); } 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | __declspec(dllexport) 47 | void ** 48 | #if defined(__BORLANDC__) 49 | __stdcall /* __stdcall appears to be the only way to get the name 50 | * decoration right with Borland C. Otherwise it works 51 | * purely incidentally, as we pass no parameters. */ 52 | #else 53 | __cdecl 54 | #endif 55 | OPENSSL_Applink(void) 56 | { static int once=1; 57 | static void *OPENSSL_ApplinkTable[APPLINK_MAX+1]={(void *)APPLINK_MAX}; 58 | 59 | if (once) 60 | { OPENSSL_ApplinkTable[APPLINK_STDIN] = app_stdin; 61 | OPENSSL_ApplinkTable[APPLINK_STDOUT] = app_stdout; 62 | OPENSSL_ApplinkTable[APPLINK_STDERR] = app_stderr; 63 | OPENSSL_ApplinkTable[APPLINK_FPRINTF] = fprintf; 64 | OPENSSL_ApplinkTable[APPLINK_FGETS] = fgets; 65 | OPENSSL_ApplinkTable[APPLINK_FREAD] = fread; 66 | OPENSSL_ApplinkTable[APPLINK_FWRITE] = fwrite; 67 | OPENSSL_ApplinkTable[APPLINK_FSETMOD] = app_fsetmod; 68 | OPENSSL_ApplinkTable[APPLINK_FEOF] = app_feof; 69 | OPENSSL_ApplinkTable[APPLINK_FCLOSE] = fclose; 70 | 71 | OPENSSL_ApplinkTable[APPLINK_FOPEN] = fopen; 72 | OPENSSL_ApplinkTable[APPLINK_FSEEK] = fseek; 73 | OPENSSL_ApplinkTable[APPLINK_FTELL] = ftell; 74 | OPENSSL_ApplinkTable[APPLINK_FFLUSH] = fflush; 75 | OPENSSL_ApplinkTable[APPLINK_FERROR] = app_ferror; 76 | OPENSSL_ApplinkTable[APPLINK_CLEARERR] = app_clearerr; 77 | OPENSSL_ApplinkTable[APPLINK_FILENO] = app_fileno; 78 | 79 | OPENSSL_ApplinkTable[APPLINK_OPEN] = _open; 80 | OPENSSL_ApplinkTable[APPLINK_READ] = _read; 81 | OPENSSL_ApplinkTable[APPLINK_WRITE] = _write; 82 | OPENSSL_ApplinkTable[APPLINK_LSEEK] = _lseek; 83 | OPENSSL_ApplinkTable[APPLINK_CLOSE] = _close; 84 | 85 | once = 0; 86 | } 87 | 88 | return OPENSSL_ApplinkTable; 89 | } 90 | 91 | #ifdef __cplusplus 92 | } 93 | #endif 94 | #endif 95 | -------------------------------------------------------------------------------- /openssl/blowfish.h: -------------------------------------------------------------------------------- 1 | /* crypto/bf/blowfish.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_BLOWFISH_H 60 | #define HEADER_BLOWFISH_H 61 | 62 | #include 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | #ifdef OPENSSL_NO_BF 69 | #error BF is disabled. 70 | #endif 71 | 72 | #define BF_ENCRYPT 1 73 | #define BF_DECRYPT 0 74 | 75 | /* 76 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 77 | * ! BF_LONG has to be at least 32 bits wide. If it's wider, then ! 78 | * ! BF_LONG_LOG2 has to be defined along. ! 79 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 80 | */ 81 | 82 | #if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) 83 | #define BF_LONG unsigned long 84 | #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 85 | #define BF_LONG unsigned long 86 | #define BF_LONG_LOG2 3 87 | /* 88 | * _CRAY note. I could declare short, but I have no idea what impact 89 | * does it have on performance on none-T3E machines. I could declare 90 | * int, but at least on C90 sizeof(int) can be chosen at compile time. 91 | * So I've chosen long... 92 | * 93 | */ 94 | #else 95 | #define BF_LONG unsigned int 96 | #endif 97 | 98 | #define BF_ROUNDS 16 99 | #define BF_BLOCK 8 100 | 101 | typedef struct bf_key_st 102 | { 103 | BF_LONG P[BF_ROUNDS+2]; 104 | BF_LONG S[4*256]; 105 | } BF_KEY; 106 | 107 | 108 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data); 109 | 110 | void BF_encrypt(BF_LONG *data,const BF_KEY *key); 111 | void BF_decrypt(BF_LONG *data,const BF_KEY *key); 112 | 113 | void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, 114 | const BF_KEY *key, int enc); 115 | void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 116 | const BF_KEY *schedule, unsigned char *ivec, int enc); 117 | void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length, 118 | const BF_KEY *schedule, unsigned char *ivec, int *num, int enc); 119 | void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, long length, 120 | const BF_KEY *schedule, unsigned char *ivec, int *num); 121 | const char *BF_options(void); 122 | 123 | #ifdef __cplusplus 124 | } 125 | #endif 126 | 127 | #endif 128 | -------------------------------------------------------------------------------- /openssl/buffer.h: -------------------------------------------------------------------------------- 1 | /* crypto/buffer/buffer.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_BUFFER_H 60 | #define HEADER_BUFFER_H 61 | 62 | #include 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | #include 69 | 70 | #if !defined(NO_SYS_TYPES_H) 71 | #include 72 | #endif 73 | 74 | /* Already declared in ossl_typ.h */ 75 | /* typedef struct buf_mem_st BUF_MEM; */ 76 | 77 | struct buf_mem_st 78 | { 79 | int length; /* current number of bytes */ 80 | char *data; 81 | int max; /* size of buffer */ 82 | }; 83 | 84 | BUF_MEM *BUF_MEM_new(void); 85 | void BUF_MEM_free(BUF_MEM *a); 86 | int BUF_MEM_grow(BUF_MEM *str, int len); 87 | int BUF_MEM_grow_clean(BUF_MEM *str, int len); 88 | char * BUF_strdup(const char *str); 89 | char * BUF_strndup(const char *str, size_t siz); 90 | void * BUF_memdup(const void *data, size_t siz); 91 | 92 | /* safe string functions */ 93 | size_t BUF_strlcpy(char *dst,const char *src,size_t siz); 94 | size_t BUF_strlcat(char *dst,const char *src,size_t siz); 95 | 96 | 97 | /* BEGIN ERROR CODES */ 98 | /* The following lines are auto generated by the script mkerr.pl. Any changes 99 | * made after this point may be overwritten when the script is next run. 100 | */ 101 | void ERR_load_BUF_strings(void); 102 | 103 | /* Error codes for the BUF functions. */ 104 | 105 | /* Function codes. */ 106 | #define BUF_F_BUF_MEMDUP 103 107 | #define BUF_F_BUF_MEM_GROW 100 108 | #define BUF_F_BUF_MEM_GROW_CLEAN 105 109 | #define BUF_F_BUF_MEM_NEW 101 110 | #define BUF_F_BUF_STRDUP 102 111 | #define BUF_F_BUF_STRNDUP 104 112 | 113 | /* Reason codes. */ 114 | 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | #endif 119 | -------------------------------------------------------------------------------- /openssl/cast.h: -------------------------------------------------------------------------------- 1 | /* crypto/cast/cast.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_CAST_H 60 | #define HEADER_CAST_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | #include 67 | 68 | #ifdef OPENSSL_NO_CAST 69 | #error CAST is disabled. 70 | #endif 71 | 72 | #define CAST_ENCRYPT 1 73 | #define CAST_DECRYPT 0 74 | 75 | #define CAST_LONG unsigned long 76 | 77 | #define CAST_BLOCK 8 78 | #define CAST_KEY_LENGTH 16 79 | 80 | typedef struct cast_key_st 81 | { 82 | CAST_LONG data[32]; 83 | int short_key; /* Use reduced rounds for short key */ 84 | } CAST_KEY; 85 | 86 | 87 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); 88 | void CAST_ecb_encrypt(const unsigned char *in,unsigned char *out,CAST_KEY *key, 89 | int enc); 90 | void CAST_encrypt(CAST_LONG *data,CAST_KEY *key); 91 | void CAST_decrypt(CAST_LONG *data,CAST_KEY *key); 92 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 93 | CAST_KEY *ks, unsigned char *iv, int enc); 94 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, 95 | long length, CAST_KEY *schedule, unsigned char *ivec, 96 | int *num, int enc); 97 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, 98 | long length, CAST_KEY *schedule, unsigned char *ivec, 99 | int *num); 100 | 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /openssl/comp.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef HEADER_COMP_H 3 | #define HEADER_COMP_H 4 | 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | typedef struct comp_ctx_st COMP_CTX; 12 | 13 | typedef struct comp_method_st 14 | { 15 | int type; /* NID for compression library */ 16 | const char *name; /* A text string to identify the library */ 17 | int (*init)(COMP_CTX *ctx); 18 | void (*finish)(COMP_CTX *ctx); 19 | int (*compress)(COMP_CTX *ctx, 20 | unsigned char *out, unsigned int olen, 21 | unsigned char *in, unsigned int ilen); 22 | int (*expand)(COMP_CTX *ctx, 23 | unsigned char *out, unsigned int olen, 24 | unsigned char *in, unsigned int ilen); 25 | /* The following two do NOTHING, but are kept for backward compatibility */ 26 | long (*ctrl)(void); 27 | long (*callback_ctrl)(void); 28 | } COMP_METHOD; 29 | 30 | struct comp_ctx_st 31 | { 32 | COMP_METHOD *meth; 33 | unsigned long compress_in; 34 | unsigned long compress_out; 35 | unsigned long expand_in; 36 | unsigned long expand_out; 37 | 38 | CRYPTO_EX_DATA ex_data; 39 | }; 40 | 41 | 42 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 43 | void COMP_CTX_free(COMP_CTX *ctx); 44 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 45 | unsigned char *in, int ilen); 46 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 47 | unsigned char *in, int ilen); 48 | COMP_METHOD *COMP_rle(void ); 49 | COMP_METHOD *COMP_zlib(void ); 50 | 51 | /* BEGIN ERROR CODES */ 52 | /* The following lines are auto generated by the script mkerr.pl. Any changes 53 | * made after this point may be overwritten when the script is next run. 54 | */ 55 | void ERR_load_COMP_strings(void); 56 | 57 | /* Error codes for the COMP functions. */ 58 | 59 | /* Function codes. */ 60 | 61 | /* Reason codes. */ 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | #endif 67 | -------------------------------------------------------------------------------- /openssl/conf.h: -------------------------------------------------------------------------------- 1 | /* crypto/conf/conf.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_CONF_H 60 | #define HEADER_CONF_H 61 | 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | 68 | #include 69 | 70 | #ifdef __cplusplus 71 | extern "C" { 72 | #endif 73 | 74 | typedef struct 75 | { 76 | char *section; 77 | char *name; 78 | char *value; 79 | } CONF_VALUE; 80 | 81 | DECLARE_STACK_OF(CONF_VALUE) 82 | DECLARE_STACK_OF(CONF_MODULE) 83 | DECLARE_STACK_OF(CONF_IMODULE) 84 | 85 | struct conf_st; 86 | struct conf_method_st; 87 | typedef struct conf_method_st CONF_METHOD; 88 | 89 | struct conf_method_st 90 | { 91 | const char *name; 92 | CONF *(*create)(CONF_METHOD *meth); 93 | int (*init)(CONF *conf); 94 | int (*destroy)(CONF *conf); 95 | int (*destroy_data)(CONF *conf); 96 | int (*load_bio)(CONF *conf, BIO *bp, long *eline); 97 | int (*dump)(const CONF *conf, BIO *bp); 98 | int (*is_number)(const CONF *conf, char c); 99 | int (*to_int)(const CONF *conf, char c); 100 | int (*load)(CONF *conf, const char *name, long *eline); 101 | }; 102 | 103 | /* Module definitions */ 104 | 105 | typedef struct conf_imodule_st CONF_IMODULE; 106 | typedef struct conf_module_st CONF_MODULE; 107 | 108 | /* DSO module function typedefs */ 109 | typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf); 110 | typedef void conf_finish_func(CONF_IMODULE *md); 111 | 112 | #define CONF_MFLAGS_IGNORE_ERRORS 0x1 113 | #define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2 114 | #define CONF_MFLAGS_SILENT 0x4 115 | #define CONF_MFLAGS_NO_DSO 0x8 116 | #define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10 117 | #define CONF_MFLAGS_DEFAULT_SECTION 0x20 118 | 119 | int CONF_set_default_method(CONF_METHOD *meth); 120 | void CONF_set_nconf(CONF *conf,LHASH *hash); 121 | LHASH *CONF_load(LHASH *conf,const char *file,long *eline); 122 | #ifndef OPENSSL_NO_FP_API 123 | LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline); 124 | #endif 125 | LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline); 126 | STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section); 127 | char *CONF_get_string(LHASH *conf,const char *group,const char *name); 128 | long CONF_get_number(LHASH *conf,const char *group,const char *name); 129 | void CONF_free(LHASH *conf); 130 | int CONF_dump_fp(LHASH *conf, FILE *out); 131 | int CONF_dump_bio(LHASH *conf, BIO *out); 132 | 133 | void OPENSSL_config(const char *config_name); 134 | void OPENSSL_no_config(void); 135 | 136 | /* New conf code. The semantics are different from the functions above. 137 | If that wasn't the case, the above functions would have been replaced */ 138 | 139 | struct conf_st 140 | { 141 | CONF_METHOD *meth; 142 | void *meth_data; 143 | LHASH *data; 144 | }; 145 | 146 | CONF *NCONF_new(CONF_METHOD *meth); 147 | CONF_METHOD *NCONF_default(void); 148 | CONF_METHOD *NCONF_WIN32(void); 149 | #if 0 /* Just to give you an idea of what I have in mind */ 150 | CONF_METHOD *NCONF_XML(void); 151 | #endif 152 | void NCONF_free(CONF *conf); 153 | void NCONF_free_data(CONF *conf); 154 | 155 | int NCONF_load(CONF *conf,const char *file,long *eline); 156 | #ifndef OPENSSL_NO_FP_API 157 | int NCONF_load_fp(CONF *conf, FILE *fp,long *eline); 158 | #endif 159 | int NCONF_load_bio(CONF *conf, BIO *bp,long *eline); 160 | STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,const char *section); 161 | char *NCONF_get_string(const CONF *conf,const char *group,const char *name); 162 | int NCONF_get_number_e(const CONF *conf,const char *group,const char *name, 163 | long *result); 164 | int NCONF_dump_fp(const CONF *conf, FILE *out); 165 | int NCONF_dump_bio(const CONF *conf, BIO *out); 166 | 167 | #if 0 /* The following function has no error checking, 168 | and should therefore be avoided */ 169 | long NCONF_get_number(CONF *conf,char *group,char *name); 170 | #else 171 | #define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) 172 | #endif 173 | 174 | /* Module functions */ 175 | 176 | int CONF_modules_load(const CONF *cnf, const char *appname, 177 | unsigned long flags); 178 | int CONF_modules_load_file(const char *filename, const char *appname, 179 | unsigned long flags); 180 | void CONF_modules_unload(int all); 181 | void CONF_modules_finish(void); 182 | void CONF_modules_free(void); 183 | int CONF_module_add(const char *name, conf_init_func *ifunc, 184 | conf_finish_func *ffunc); 185 | 186 | const char *CONF_imodule_get_name(const CONF_IMODULE *md); 187 | const char *CONF_imodule_get_value(const CONF_IMODULE *md); 188 | void *CONF_imodule_get_usr_data(const CONF_IMODULE *md); 189 | void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data); 190 | CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md); 191 | unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md); 192 | void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags); 193 | void *CONF_module_get_usr_data(CONF_MODULE *pmod); 194 | void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data); 195 | 196 | char *CONF_get1_default_config_file(void); 197 | 198 | int CONF_parse_list(const char *list, int sep, int nospc, 199 | int (*list_cb)(const char *elem, int len, void *usr), void *arg); 200 | 201 | void OPENSSL_load_builtin_modules(void); 202 | 203 | /* BEGIN ERROR CODES */ 204 | /* The following lines are auto generated by the script mkerr.pl. Any changes 205 | * made after this point may be overwritten when the script is next run. 206 | */ 207 | void ERR_load_CONF_strings(void); 208 | 209 | /* Error codes for the CONF functions. */ 210 | 211 | /* Function codes. */ 212 | #define CONF_F_CONF_DUMP_FP 104 213 | #define CONF_F_CONF_LOAD 100 214 | #define CONF_F_CONF_LOAD_BIO 102 215 | #define CONF_F_CONF_LOAD_FP 103 216 | #define CONF_F_CONF_MODULES_LOAD 116 217 | #define CONF_F_DEF_LOAD 120 218 | #define CONF_F_DEF_LOAD_BIO 121 219 | #define CONF_F_MODULE_INIT 115 220 | #define CONF_F_MODULE_LOAD_DSO 117 221 | #define CONF_F_MODULE_RUN 118 222 | #define CONF_F_NCONF_DUMP_BIO 105 223 | #define CONF_F_NCONF_DUMP_FP 106 224 | #define CONF_F_NCONF_GET_NUMBER 107 225 | #define CONF_F_NCONF_GET_NUMBER_E 112 226 | #define CONF_F_NCONF_GET_SECTION 108 227 | #define CONF_F_NCONF_GET_STRING 109 228 | #define CONF_F_NCONF_LOAD 113 229 | #define CONF_F_NCONF_LOAD_BIO 110 230 | #define CONF_F_NCONF_LOAD_FP 114 231 | #define CONF_F_NCONF_NEW 111 232 | #define CONF_F_STR_COPY 101 233 | 234 | /* Reason codes. */ 235 | #define CONF_R_ERROR_LOADING_DSO 110 236 | #define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 237 | #define CONF_R_MISSING_EQUAL_SIGN 101 238 | #define CONF_R_MISSING_FINISH_FUNCTION 111 239 | #define CONF_R_MISSING_INIT_FUNCTION 112 240 | #define CONF_R_MODULE_INITIALIZATION_ERROR 109 241 | #define CONF_R_NO_CLOSE_BRACE 102 242 | #define CONF_R_NO_CONF 105 243 | #define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106 244 | #define CONF_R_NO_SECTION 107 245 | #define CONF_R_NO_SUCH_FILE 114 246 | #define CONF_R_NO_VALUE 108 247 | #define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 248 | #define CONF_R_UNKNOWN_MODULE_NAME 113 249 | #define CONF_R_VARIABLE_HAS_NO_VALUE 104 250 | 251 | #ifdef __cplusplus 252 | } 253 | #endif 254 | #endif 255 | -------------------------------------------------------------------------------- /openssl/conf_api.h: -------------------------------------------------------------------------------- 1 | /* conf_api.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_CONF_API_H 60 | #define HEADER_CONF_API_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /* Up until OpenSSL 0.9.5a, this was new_section */ 70 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); 71 | /* Up until OpenSSL 0.9.5a, this was get_section */ 72 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); 73 | /* Up until OpenSSL 0.9.5a, this was CONF_get_section */ 74 | STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, 75 | const char *section); 76 | 77 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); 78 | char *_CONF_get_string(const CONF *conf, const char *section, 79 | const char *name); 80 | long _CONF_get_number(const CONF *conf, const char *section, const char *name); 81 | 82 | int _CONF_new_data(CONF *conf); 83 | void _CONF_free_data(CONF *conf); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /openssl/dh.h: -------------------------------------------------------------------------------- 1 | /* crypto/dh/dh.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_DH_H 60 | #define HEADER_DH_H 61 | 62 | #include 63 | 64 | #ifdef OPENSSL_NO_DH 65 | #error DH is disabled. 66 | #endif 67 | 68 | #ifndef OPENSSL_NO_BIO 69 | #include 70 | #endif 71 | #include 72 | #ifndef OPENSSL_NO_DEPRECATED 73 | #include 74 | #endif 75 | 76 | #ifndef OPENSSL_DH_MAX_MODULUS_BITS 77 | # define OPENSSL_DH_MAX_MODULUS_BITS 10000 78 | #endif 79 | 80 | #define DH_FLAG_CACHE_MONT_P 0x01 81 | #define DH_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DH 82 | * implementation now uses constant time 83 | * modular exponentiation for secret exponents 84 | * by default. This flag causes the 85 | * faster variable sliding window method to 86 | * be used for all exponents. 87 | */ 88 | 89 | #ifdef __cplusplus 90 | extern "C" { 91 | #endif 92 | 93 | /* Already defined in ossl_typ.h */ 94 | /* typedef struct dh_st DH; */ 95 | /* typedef struct dh_method DH_METHOD; */ 96 | 97 | struct dh_method 98 | { 99 | const char *name; 100 | /* Methods here */ 101 | int (*generate_key)(DH *dh); 102 | int (*compute_key)(unsigned char *key,const BIGNUM *pub_key,DH *dh); 103 | int (*bn_mod_exp)(const DH *dh, BIGNUM *r, const BIGNUM *a, 104 | const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, 105 | BN_MONT_CTX *m_ctx); /* Can be null */ 106 | 107 | int (*init)(DH *dh); 108 | int (*finish)(DH *dh); 109 | int flags; 110 | char *app_data; 111 | /* If this is non-NULL, it will be used to generate parameters */ 112 | int (*generate_params)(DH *dh, int prime_len, int generator, BN_GENCB *cb); 113 | }; 114 | 115 | struct dh_st 116 | { 117 | /* This first argument is used to pick up errors when 118 | * a DH is passed instead of a EVP_PKEY */ 119 | int pad; 120 | int version; 121 | BIGNUM *p; 122 | BIGNUM *g; 123 | long length; /* optional */ 124 | BIGNUM *pub_key; /* g^x */ 125 | BIGNUM *priv_key; /* x */ 126 | 127 | int flags; 128 | BN_MONT_CTX *method_mont_p; 129 | /* Place holders if we want to do X9.42 DH */ 130 | BIGNUM *q; 131 | BIGNUM *j; 132 | unsigned char *seed; 133 | int seedlen; 134 | BIGNUM *counter; 135 | 136 | int references; 137 | CRYPTO_EX_DATA ex_data; 138 | const DH_METHOD *meth; 139 | ENGINE *engine; 140 | }; 141 | 142 | #define DH_GENERATOR_2 2 143 | /* #define DH_GENERATOR_3 3 */ 144 | #define DH_GENERATOR_5 5 145 | 146 | /* DH_check error codes */ 147 | #define DH_CHECK_P_NOT_PRIME 0x01 148 | #define DH_CHECK_P_NOT_SAFE_PRIME 0x02 149 | #define DH_UNABLE_TO_CHECK_GENERATOR 0x04 150 | #define DH_NOT_SUITABLE_GENERATOR 0x08 151 | 152 | /* DH_check_pub_key error codes */ 153 | #define DH_CHECK_PUBKEY_TOO_SMALL 0x01 154 | #define DH_CHECK_PUBKEY_TOO_LARGE 0x02 155 | 156 | /* primes p where (p-1)/2 is prime too are called "safe"; we define 157 | this for backward compatibility: */ 158 | #define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME 159 | 160 | #define DHparams_dup(x) ASN1_dup_of_const(DH,i2d_DHparams,d2i_DHparams,x) 161 | #define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ 162 | (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) 163 | #define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ 164 | (unsigned char *)(x)) 165 | #define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) 166 | #define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) 167 | 168 | const DH_METHOD *DH_OpenSSL(void); 169 | 170 | void DH_set_default_method(const DH_METHOD *meth); 171 | const DH_METHOD *DH_get_default_method(void); 172 | int DH_set_method(DH *dh, const DH_METHOD *meth); 173 | DH *DH_new_method(ENGINE *engine); 174 | 175 | DH * DH_new(void); 176 | void DH_free(DH *dh); 177 | int DH_up_ref(DH *dh); 178 | int DH_size(const DH *dh); 179 | int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 180 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 181 | int DH_set_ex_data(DH *d, int idx, void *arg); 182 | void *DH_get_ex_data(DH *d, int idx); 183 | 184 | /* Deprecated version */ 185 | #ifndef OPENSSL_NO_DEPRECATED 186 | DH * DH_generate_parameters(int prime_len,int generator, 187 | void (*callback)(int,int,void *),void *cb_arg); 188 | #endif /* !defined(OPENSSL_NO_DEPRECATED) */ 189 | 190 | /* New version */ 191 | int DH_generate_parameters_ex(DH *dh, int prime_len,int generator, BN_GENCB *cb); 192 | 193 | int DH_check(const DH *dh,int *codes); 194 | int DH_check_pub_key(const DH *dh,const BIGNUM *pub_key, int *codes); 195 | int DH_generate_key(DH *dh); 196 | int DH_compute_key(unsigned char *key,const BIGNUM *pub_key,DH *dh); 197 | DH * d2i_DHparams(DH **a,const unsigned char **pp, long length); 198 | int i2d_DHparams(const DH *a,unsigned char **pp); 199 | #ifndef OPENSSL_NO_FP_API 200 | int DHparams_print_fp(FILE *fp, const DH *x); 201 | #endif 202 | #ifndef OPENSSL_NO_BIO 203 | int DHparams_print(BIO *bp, const DH *x); 204 | #else 205 | int DHparams_print(char *bp, const DH *x); 206 | #endif 207 | 208 | /* BEGIN ERROR CODES */ 209 | /* The following lines are auto generated by the script mkerr.pl. Any changes 210 | * made after this point may be overwritten when the script is next run. 211 | */ 212 | void ERR_load_DH_strings(void); 213 | 214 | /* Error codes for the DH functions. */ 215 | 216 | /* Function codes. */ 217 | #define DH_F_COMPUTE_KEY 102 218 | #define DH_F_DHPARAMS_PRINT 100 219 | #define DH_F_DHPARAMS_PRINT_FP 101 220 | #define DH_F_DH_BUILTIN_GENPARAMS 106 221 | #define DH_F_DH_NEW_METHOD 105 222 | #define DH_F_GENERATE_KEY 103 223 | #define DH_F_GENERATE_PARAMETERS 104 224 | 225 | /* Reason codes. */ 226 | #define DH_R_BAD_GENERATOR 101 227 | #define DH_R_INVALID_PUBKEY 102 228 | #define DH_R_MODULUS_TOO_LARGE 103 229 | #define DH_R_NO_PRIVATE_VALUE 100 230 | 231 | #ifdef __cplusplus 232 | } 233 | #endif 234 | #endif 235 | -------------------------------------------------------------------------------- /openssl/dtls1.h: -------------------------------------------------------------------------------- 1 | /* ssl/dtls1.h */ 2 | /* 3 | * DTLS implementation written by Nagendra Modadugu 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * openssl-core@OpenSSL.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | 60 | #ifndef HEADER_DTLS1_H 61 | #define HEADER_DTLS1_H 62 | 63 | #include 64 | #include 65 | 66 | #ifdef __cplusplus 67 | extern "C" { 68 | #endif 69 | 70 | #define DTLS1_VERSION 0xFEFF 71 | #define DTLS1_BAD_VER 0x0100 72 | 73 | #define DTLS1_AD_MISSING_HANDSHAKE_MESSAGE 110 74 | 75 | /* lengths of messages */ 76 | #define DTLS1_COOKIE_LENGTH 32 77 | 78 | #define DTLS1_RT_HEADER_LENGTH 13 79 | 80 | #define DTLS1_HM_HEADER_LENGTH 12 81 | 82 | #define DTLS1_HM_BAD_FRAGMENT -2 83 | #define DTLS1_HM_FRAGMENT_RETRY -3 84 | 85 | #define DTLS1_CCS_HEADER_LENGTH 1 86 | 87 | #define DTLS1_AL_HEADER_LENGTH 7 88 | 89 | 90 | typedef struct dtls1_bitmap_st 91 | { 92 | PQ_64BIT map; 93 | unsigned long length; /* sizeof the bitmap in bits */ 94 | PQ_64BIT max_seq_num; /* max record number seen so far */ 95 | } DTLS1_BITMAP; 96 | 97 | struct hm_header_st 98 | { 99 | unsigned char type; 100 | unsigned long msg_len; 101 | unsigned short seq; 102 | unsigned long frag_off; 103 | unsigned long frag_len; 104 | unsigned int is_ccs; 105 | }; 106 | 107 | struct ccs_header_st 108 | { 109 | unsigned char type; 110 | unsigned short seq; 111 | }; 112 | 113 | struct dtls1_timeout_st 114 | { 115 | /* Number of read timeouts so far */ 116 | unsigned int read_timeouts; 117 | 118 | /* Number of write timeouts so far */ 119 | unsigned int write_timeouts; 120 | 121 | /* Number of alerts received so far */ 122 | unsigned int num_alerts; 123 | }; 124 | 125 | typedef struct record_pqueue_st 126 | { 127 | unsigned short epoch; 128 | pqueue q; 129 | } record_pqueue; 130 | 131 | typedef struct hm_fragment_st 132 | { 133 | struct hm_header_st msg_header; 134 | unsigned char *fragment; 135 | } hm_fragment; 136 | 137 | typedef struct dtls1_state_st 138 | { 139 | unsigned int send_cookie; 140 | unsigned char cookie[DTLS1_COOKIE_LENGTH]; 141 | unsigned char rcvd_cookie[DTLS1_COOKIE_LENGTH]; 142 | unsigned int cookie_len; 143 | 144 | /* 145 | * The current data and handshake epoch. This is initially 146 | * undefined, and starts at zero once the initial handshake is 147 | * completed 148 | */ 149 | unsigned short r_epoch; 150 | unsigned short w_epoch; 151 | 152 | /* records being received in the current epoch */ 153 | DTLS1_BITMAP bitmap; 154 | 155 | /* renegotiation starts a new set of sequence numbers */ 156 | DTLS1_BITMAP next_bitmap; 157 | 158 | /* handshake message numbers */ 159 | unsigned short handshake_write_seq; 160 | unsigned short next_handshake_write_seq; 161 | 162 | unsigned short handshake_read_seq; 163 | 164 | /* Received handshake records (processed and unprocessed) */ 165 | record_pqueue unprocessed_rcds; 166 | record_pqueue processed_rcds; 167 | 168 | /* Buffered handshake messages */ 169 | pqueue buffered_messages; 170 | 171 | /* Buffered (sent) handshake records */ 172 | pqueue sent_messages; 173 | 174 | unsigned int mtu; /* max wire packet size */ 175 | 176 | struct hm_header_st w_msg_hdr; 177 | struct hm_header_st r_msg_hdr; 178 | 179 | struct dtls1_timeout_st timeout; 180 | 181 | /* storage for Alert/Handshake protocol data received but not 182 | * yet processed by ssl3_read_bytes: */ 183 | unsigned char alert_fragment[DTLS1_AL_HEADER_LENGTH]; 184 | unsigned int alert_fragment_len; 185 | unsigned char handshake_fragment[DTLS1_HM_HEADER_LENGTH]; 186 | unsigned int handshake_fragment_len; 187 | 188 | unsigned int retransmitting; 189 | 190 | } DTLS1_STATE; 191 | 192 | typedef struct dtls1_record_data_st 193 | { 194 | unsigned char *packet; 195 | unsigned int packet_length; 196 | SSL3_BUFFER rbuf; 197 | SSL3_RECORD rrec; 198 | } DTLS1_RECORD_DATA; 199 | 200 | 201 | /* Timeout multipliers (timeout slice is defined in apps/timeouts.h */ 202 | #define DTLS1_TMO_READ_COUNT 2 203 | #define DTLS1_TMO_WRITE_COUNT 2 204 | 205 | #define DTLS1_TMO_ALERT_COUNT 12 206 | 207 | #ifdef __cplusplus 208 | } 209 | #endif 210 | #endif 211 | 212 | -------------------------------------------------------------------------------- /openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | #define HEADER_EBCDIC_H 5 | 6 | #include 7 | 8 | /* Avoid name clashes with other applications */ 9 | #define os_toascii _openssl_os_toascii 10 | #define os_toebcdic _openssl_os_toebcdic 11 | #define ebcdic2ascii _openssl_ebcdic2ascii 12 | #define ascii2ebcdic _openssl_ascii2ebcdic 13 | 14 | extern const unsigned char os_toascii[256]; 15 | extern const unsigned char os_toebcdic[256]; 16 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 17 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /openssl/ecdh.h: -------------------------------------------------------------------------------- 1 | /* crypto/ecdh/ecdh.h */ 2 | /* ==================================================================== 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 4 | * 5 | * The Elliptic Curve Public-Key Crypto Library (ECC Code) included 6 | * herein is developed by SUN MICROSYSTEMS, INC., and is contributed 7 | * to the OpenSSL project. 8 | * 9 | * The ECC Code is licensed pursuant to the OpenSSL open source 10 | * license provided below. 11 | * 12 | * The ECDH software is originally written by Douglas Stebila of 13 | * Sun Microsystems Laboratories. 14 | * 15 | */ 16 | /* ==================================================================== 17 | * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. 18 | * 19 | * Redistribution and use in source and binary forms, with or without 20 | * modification, are permitted provided that the following conditions 21 | * are met: 22 | * 23 | * 1. Redistributions of source code must retain the above copyright 24 | * notice, this list of conditions and the following disclaimer. 25 | * 26 | * 2. Redistributions in binary form must reproduce the above copyright 27 | * notice, this list of conditions and the following disclaimer in 28 | * the documentation and/or other materials provided with the 29 | * distribution. 30 | * 31 | * 3. All advertising materials mentioning features or use of this 32 | * software must display the following acknowledgment: 33 | * "This product includes software developed by the OpenSSL Project 34 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 35 | * 36 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 37 | * endorse or promote products derived from this software without 38 | * prior written permission. For written permission, please contact 39 | * licensing@OpenSSL.org. 40 | * 41 | * 5. Products derived from this software may not be called "OpenSSL" 42 | * nor may "OpenSSL" appear in their names without prior written 43 | * permission of the OpenSSL Project. 44 | * 45 | * 6. Redistributions of any form whatsoever must retain the following 46 | * acknowledgment: 47 | * "This product includes software developed by the OpenSSL Project 48 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 49 | * 50 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 51 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 52 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 53 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 54 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 55 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 56 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 57 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 59 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 60 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 61 | * OF THE POSSIBILITY OF SUCH DAMAGE. 62 | * ==================================================================== 63 | * 64 | * This product includes cryptographic software written by Eric Young 65 | * (eay@cryptsoft.com). This product includes software written by Tim 66 | * Hudson (tjh@cryptsoft.com). 67 | * 68 | */ 69 | #ifndef HEADER_ECDH_H 70 | #define HEADER_ECDH_H 71 | 72 | #include 73 | 74 | #ifdef OPENSSL_NO_ECDH 75 | #error ECDH is disabled. 76 | #endif 77 | 78 | #include 79 | #include 80 | #ifndef OPENSSL_NO_DEPRECATED 81 | #include 82 | #endif 83 | 84 | #ifdef __cplusplus 85 | extern "C" { 86 | #endif 87 | 88 | const ECDH_METHOD *ECDH_OpenSSL(void); 89 | 90 | void ECDH_set_default_method(const ECDH_METHOD *); 91 | const ECDH_METHOD *ECDH_get_default_method(void); 92 | int ECDH_set_method(EC_KEY *, const ECDH_METHOD *); 93 | 94 | int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, 95 | void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)); 96 | 97 | int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new 98 | *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 99 | int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg); 100 | void *ECDH_get_ex_data(EC_KEY *d, int idx); 101 | 102 | 103 | /* BEGIN ERROR CODES */ 104 | /* The following lines are auto generated by the script mkerr.pl. Any changes 105 | * made after this point may be overwritten when the script is next run. 106 | */ 107 | void ERR_load_ECDH_strings(void); 108 | 109 | /* Error codes for the ECDH functions. */ 110 | 111 | /* Function codes. */ 112 | #define ECDH_F_ECDH_COMPUTE_KEY 100 113 | #define ECDH_F_ECDH_DATA_NEW_METHOD 101 114 | 115 | /* Reason codes. */ 116 | #define ECDH_R_KDF_FAILED 102 117 | #define ECDH_R_NO_PRIVATE_VALUE 100 118 | #define ECDH_R_POINT_ARITHMETIC_FAILURE 101 119 | 120 | #ifdef __cplusplus 121 | } 122 | #endif 123 | #endif 124 | -------------------------------------------------------------------------------- /openssl/hmac.h: -------------------------------------------------------------------------------- 1 | /* crypto/hmac/hmac.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | #ifndef HEADER_HMAC_H 59 | #define HEADER_HMAC_H 60 | 61 | #include 62 | 63 | #ifdef OPENSSL_NO_HMAC 64 | #error HMAC is disabled. 65 | #endif 66 | 67 | #include 68 | 69 | #define HMAC_MAX_MD_CBLOCK 128 /* largest known is SHA512 */ 70 | 71 | #ifdef __cplusplus 72 | extern "C" { 73 | #endif 74 | 75 | typedef struct hmac_ctx_st 76 | { 77 | const EVP_MD *md; 78 | EVP_MD_CTX md_ctx; 79 | EVP_MD_CTX i_ctx; 80 | EVP_MD_CTX o_ctx; 81 | unsigned int key_length; 82 | unsigned char key[HMAC_MAX_MD_CBLOCK]; 83 | } HMAC_CTX; 84 | 85 | #define HMAC_size(e) (EVP_MD_size((e)->md)) 86 | 87 | 88 | void HMAC_CTX_init(HMAC_CTX *ctx); 89 | void HMAC_CTX_cleanup(HMAC_CTX *ctx); 90 | 91 | #define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */ 92 | 93 | void HMAC_Init(HMAC_CTX *ctx, const void *key, int len, 94 | const EVP_MD *md); /* deprecated */ 95 | void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, 96 | const EVP_MD *md, ENGINE *impl); 97 | void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); 98 | void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); 99 | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, 100 | const unsigned char *d, size_t n, unsigned char *md, 101 | unsigned int *md_len); 102 | 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /openssl/idea.h: -------------------------------------------------------------------------------- 1 | /* crypto/idea/idea.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_IDEA_H 60 | #define HEADER_IDEA_H 61 | 62 | #include /* IDEA_INT, OPENSSL_NO_IDEA */ 63 | 64 | #ifdef OPENSSL_NO_IDEA 65 | #error IDEA is disabled. 66 | #endif 67 | 68 | #define IDEA_ENCRYPT 1 69 | #define IDEA_DECRYPT 0 70 | 71 | #define IDEA_BLOCK 8 72 | #define IDEA_KEY_LENGTH 16 73 | 74 | #ifdef __cplusplus 75 | extern "C" { 76 | #endif 77 | 78 | typedef struct idea_key_st 79 | { 80 | IDEA_INT data[9][6]; 81 | } IDEA_KEY_SCHEDULE; 82 | 83 | const char *idea_options(void); 84 | void idea_ecb_encrypt(const unsigned char *in, unsigned char *out, 85 | IDEA_KEY_SCHEDULE *ks); 86 | void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); 87 | void idea_set_decrypt_key(const IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); 88 | void idea_cbc_encrypt(const unsigned char *in, unsigned char *out, 89 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,int enc); 90 | void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out, 91 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 92 | int *num,int enc); 93 | void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out, 94 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num); 95 | void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /openssl/krb5_asn.h: -------------------------------------------------------------------------------- 1 | /* krb5_asn.h */ 2 | /* Written by Vern Staats for the OpenSSL project, 3 | ** using ocsp/{*.h,*asn*.c} as a starting point 4 | */ 5 | 6 | /* ==================================================================== 7 | * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * openssl-core@openssl.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | 60 | #ifndef HEADER_KRB5_ASN_H 61 | #define HEADER_KRB5_ASN_H 62 | 63 | /* 64 | #include 65 | */ 66 | #include 67 | 68 | #ifdef __cplusplus 69 | extern "C" { 70 | #endif 71 | 72 | 73 | /* ASN.1 from Kerberos RFC 1510 74 | */ 75 | 76 | /* EncryptedData ::= SEQUENCE { 77 | ** etype[0] INTEGER, -- EncryptionType 78 | ** kvno[1] INTEGER OPTIONAL, 79 | ** cipher[2] OCTET STRING -- ciphertext 80 | ** } 81 | */ 82 | typedef struct krb5_encdata_st 83 | { 84 | ASN1_INTEGER *etype; 85 | ASN1_INTEGER *kvno; 86 | ASN1_OCTET_STRING *cipher; 87 | } KRB5_ENCDATA; 88 | 89 | DECLARE_STACK_OF(KRB5_ENCDATA) 90 | 91 | /* PrincipalName ::= SEQUENCE { 92 | ** name-type[0] INTEGER, 93 | ** name-string[1] SEQUENCE OF GeneralString 94 | ** } 95 | */ 96 | typedef struct krb5_princname_st 97 | { 98 | ASN1_INTEGER *nametype; 99 | STACK_OF(ASN1_GENERALSTRING) *namestring; 100 | } KRB5_PRINCNAME; 101 | 102 | DECLARE_STACK_OF(KRB5_PRINCNAME) 103 | 104 | 105 | /* Ticket ::= [APPLICATION 1] SEQUENCE { 106 | ** tkt-vno[0] INTEGER, 107 | ** realm[1] Realm, 108 | ** sname[2] PrincipalName, 109 | ** enc-part[3] EncryptedData 110 | ** } 111 | */ 112 | typedef struct krb5_tktbody_st 113 | { 114 | ASN1_INTEGER *tktvno; 115 | ASN1_GENERALSTRING *realm; 116 | KRB5_PRINCNAME *sname; 117 | KRB5_ENCDATA *encdata; 118 | } KRB5_TKTBODY; 119 | 120 | typedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET; 121 | DECLARE_STACK_OF(KRB5_TKTBODY) 122 | 123 | 124 | /* AP-REQ ::= [APPLICATION 14] SEQUENCE { 125 | ** pvno[0] INTEGER, 126 | ** msg-type[1] INTEGER, 127 | ** ap-options[2] APOptions, 128 | ** ticket[3] Ticket, 129 | ** authenticator[4] EncryptedData 130 | ** } 131 | ** 132 | ** APOptions ::= BIT STRING { 133 | ** reserved(0), use-session-key(1), mutual-required(2) } 134 | */ 135 | typedef struct krb5_ap_req_st 136 | { 137 | ASN1_INTEGER *pvno; 138 | ASN1_INTEGER *msgtype; 139 | ASN1_BIT_STRING *apoptions; 140 | KRB5_TICKET *ticket; 141 | KRB5_ENCDATA *authenticator; 142 | } KRB5_APREQBODY; 143 | 144 | typedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ; 145 | DECLARE_STACK_OF(KRB5_APREQBODY) 146 | 147 | 148 | /* Authenticator Stuff */ 149 | 150 | 151 | /* Checksum ::= SEQUENCE { 152 | ** cksumtype[0] INTEGER, 153 | ** checksum[1] OCTET STRING 154 | ** } 155 | */ 156 | typedef struct krb5_checksum_st 157 | { 158 | ASN1_INTEGER *ctype; 159 | ASN1_OCTET_STRING *checksum; 160 | } KRB5_CHECKSUM; 161 | 162 | DECLARE_STACK_OF(KRB5_CHECKSUM) 163 | 164 | 165 | /* EncryptionKey ::= SEQUENCE { 166 | ** keytype[0] INTEGER, 167 | ** keyvalue[1] OCTET STRING 168 | ** } 169 | */ 170 | typedef struct krb5_encryptionkey_st 171 | { 172 | ASN1_INTEGER *ktype; 173 | ASN1_OCTET_STRING *keyvalue; 174 | } KRB5_ENCKEY; 175 | 176 | DECLARE_STACK_OF(KRB5_ENCKEY) 177 | 178 | 179 | /* AuthorizationData ::= SEQUENCE OF SEQUENCE { 180 | ** ad-type[0] INTEGER, 181 | ** ad-data[1] OCTET STRING 182 | ** } 183 | */ 184 | typedef struct krb5_authorization_st 185 | { 186 | ASN1_INTEGER *adtype; 187 | ASN1_OCTET_STRING *addata; 188 | } KRB5_AUTHDATA; 189 | 190 | DECLARE_STACK_OF(KRB5_AUTHDATA) 191 | 192 | 193 | /* -- Unencrypted authenticator 194 | ** Authenticator ::= [APPLICATION 2] SEQUENCE { 195 | ** authenticator-vno[0] INTEGER, 196 | ** crealm[1] Realm, 197 | ** cname[2] PrincipalName, 198 | ** cksum[3] Checksum OPTIONAL, 199 | ** cusec[4] INTEGER, 200 | ** ctime[5] KerberosTime, 201 | ** subkey[6] EncryptionKey OPTIONAL, 202 | ** seq-number[7] INTEGER OPTIONAL, 203 | ** authorization-data[8] AuthorizationData OPTIONAL 204 | ** } 205 | */ 206 | typedef struct krb5_authenticator_st 207 | { 208 | ASN1_INTEGER *avno; 209 | ASN1_GENERALSTRING *crealm; 210 | KRB5_PRINCNAME *cname; 211 | KRB5_CHECKSUM *cksum; 212 | ASN1_INTEGER *cusec; 213 | ASN1_GENERALIZEDTIME *ctime; 214 | KRB5_ENCKEY *subkey; 215 | ASN1_INTEGER *seqnum; 216 | KRB5_AUTHDATA *authorization; 217 | } KRB5_AUTHENTBODY; 218 | 219 | typedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT; 220 | DECLARE_STACK_OF(KRB5_AUTHENTBODY) 221 | 222 | 223 | /* DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) = 224 | ** type *name##_new(void); 225 | ** void name##_free(type *a); 226 | ** DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) = 227 | ** DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) = 228 | ** type *d2i_##name(type **a, const unsigned char **in, long len); 229 | ** int i2d_##name(type *a, unsigned char **out); 230 | ** DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it 231 | */ 232 | 233 | DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA) 234 | DECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME) 235 | DECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY) 236 | DECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY) 237 | DECLARE_ASN1_FUNCTIONS(KRB5_TICKET) 238 | DECLARE_ASN1_FUNCTIONS(KRB5_APREQ) 239 | 240 | DECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM) 241 | DECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY) 242 | DECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA) 243 | DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY) 244 | DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT) 245 | 246 | 247 | /* BEGIN ERROR CODES */ 248 | /* The following lines are auto generated by the script mkerr.pl. Any changes 249 | * made after this point may be overwritten when the script is next run. 250 | */ 251 | 252 | #ifdef __cplusplus 253 | } 254 | #endif 255 | #endif 256 | 257 | -------------------------------------------------------------------------------- /openssl/kssl.h: -------------------------------------------------------------------------------- 1 | /* ssl/kssl.h -*- mode: C; c-file-style: "eay" -*- */ 2 | /* Written by Vern Staats for the OpenSSL project 2000. 3 | * project 2000. 4 | */ 5 | /* ==================================================================== 6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * 3. All advertising materials mentioning features or use of this 21 | * software must display the following acknowledgment: 22 | * "This product includes software developed by the OpenSSL Project 23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 24 | * 25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 26 | * endorse or promote products derived from this software without 27 | * prior written permission. For written permission, please contact 28 | * licensing@OpenSSL.org. 29 | * 30 | * 5. Products derived from this software may not be called "OpenSSL" 31 | * nor may "OpenSSL" appear in their names without prior written 32 | * permission of the OpenSSL Project. 33 | * 34 | * 6. Redistributions of any form whatsoever must retain the following 35 | * acknowledgment: 36 | * "This product includes software developed by the OpenSSL Project 37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 38 | * 39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50 | * OF THE POSSIBILITY OF SUCH DAMAGE. 51 | * ==================================================================== 52 | * 53 | * This product includes cryptographic software written by Eric Young 54 | * (eay@cryptsoft.com). This product includes software written by Tim 55 | * Hudson (tjh@cryptsoft.com). 56 | * 57 | */ 58 | 59 | /* 60 | ** 19990701 VRS Started. 61 | */ 62 | 63 | #ifndef KSSL_H 64 | #define KSSL_H 65 | 66 | #include 67 | 68 | #ifndef OPENSSL_NO_KRB5 69 | 70 | #include 71 | #include 72 | #include 73 | 74 | #ifdef __cplusplus 75 | extern "C" { 76 | #endif 77 | 78 | /* 79 | ** Depending on which KRB5 implementation used, some types from 80 | ** the other may be missing. Resolve that here and now 81 | */ 82 | #ifdef KRB5_HEIMDAL 83 | typedef unsigned char krb5_octet; 84 | #define FAR 85 | #else 86 | 87 | #ifndef FAR 88 | #define FAR 89 | #endif 90 | 91 | #endif 92 | 93 | /* Uncomment this to debug kssl problems or 94 | ** to trace usage of the Kerberos session key 95 | ** 96 | ** #define KSSL_DEBUG 97 | */ 98 | 99 | #ifndef KRB5SVC 100 | #define KRB5SVC "host" 101 | #endif 102 | 103 | #ifndef KRB5KEYTAB 104 | #define KRB5KEYTAB "/etc/krb5.keytab" 105 | #endif 106 | 107 | #ifndef KRB5SENDAUTH 108 | #define KRB5SENDAUTH 1 109 | #endif 110 | 111 | #ifndef KRB5CHECKAUTH 112 | #define KRB5CHECKAUTH 1 113 | #endif 114 | 115 | #ifndef KSSL_CLOCKSKEW 116 | #define KSSL_CLOCKSKEW 300; 117 | #endif 118 | 119 | #define KSSL_ERR_MAX 255 120 | typedef struct kssl_err_st { 121 | int reason; 122 | char text[KSSL_ERR_MAX+1]; 123 | } KSSL_ERR; 124 | 125 | 126 | /* Context for passing 127 | ** (1) Kerberos session key to SSL, and 128 | ** (2) Config data between application and SSL lib 129 | */ 130 | typedef struct kssl_ctx_st 131 | { 132 | /* used by: disposition: */ 133 | char *service_name; /* C,S default ok (kssl) */ 134 | char *service_host; /* C input, REQUIRED */ 135 | char *client_princ; /* S output from krb5 ticket */ 136 | char *keytab_file; /* S NULL (/etc/krb5.keytab) */ 137 | char *cred_cache; /* C NULL (default) */ 138 | krb5_enctype enctype; 139 | int length; 140 | krb5_octet FAR *key; 141 | } KSSL_CTX; 142 | 143 | #define KSSL_CLIENT 1 144 | #define KSSL_SERVER 2 145 | #define KSSL_SERVICE 3 146 | #define KSSL_KEYTAB 4 147 | 148 | #define KSSL_CTX_OK 0 149 | #define KSSL_CTX_ERR 1 150 | #define KSSL_NOMEM 2 151 | 152 | /* Public (for use by applications that use OpenSSL with Kerberos 5 support */ 153 | krb5_error_code kssl_ctx_setstring(KSSL_CTX *kssl_ctx, int which, char *text); 154 | KSSL_CTX *kssl_ctx_new(void); 155 | KSSL_CTX *kssl_ctx_free(KSSL_CTX *kssl_ctx); 156 | void kssl_ctx_show(KSSL_CTX *kssl_ctx); 157 | krb5_error_code kssl_ctx_setprinc(KSSL_CTX *kssl_ctx, int which, 158 | krb5_data *realm, krb5_data *entity, int nentities); 159 | krb5_error_code kssl_cget_tkt(KSSL_CTX *kssl_ctx, krb5_data **enc_tktp, 160 | krb5_data *authenp, KSSL_ERR *kssl_err); 161 | krb5_error_code kssl_sget_tkt(KSSL_CTX *kssl_ctx, krb5_data *indata, 162 | krb5_ticket_times *ttimes, KSSL_ERR *kssl_err); 163 | krb5_error_code kssl_ctx_setkey(KSSL_CTX *kssl_ctx, krb5_keyblock *session); 164 | void kssl_err_set(KSSL_ERR *kssl_err, int reason, char *text); 165 | void kssl_krb5_free_data_contents(krb5_context context, krb5_data *data); 166 | krb5_error_code kssl_build_principal_2(krb5_context context, 167 | krb5_principal *princ, int rlen, const char *realm, 168 | int slen, const char *svc, int hlen, const char *host); 169 | krb5_error_code kssl_validate_times(krb5_timestamp atime, 170 | krb5_ticket_times *ttimes); 171 | krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp, 172 | krb5_timestamp *atimep, KSSL_ERR *kssl_err); 173 | unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn); 174 | 175 | #ifdef __cplusplus 176 | } 177 | #endif 178 | #endif /* OPENSSL_NO_KRB5 */ 179 | #endif /* KSSL_H */ 180 | -------------------------------------------------------------------------------- /openssl/lhash.h: -------------------------------------------------------------------------------- 1 | /* crypto/lhash/lhash.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | /* Header for dynamic hash table routines 60 | * Author - Eric Young 61 | */ 62 | 63 | #ifndef HEADER_LHASH_H 64 | #define HEADER_LHASH_H 65 | 66 | #include 67 | #ifndef OPENSSL_NO_FP_API 68 | #include 69 | #endif 70 | 71 | #ifndef OPENSSL_NO_BIO 72 | #include 73 | #endif 74 | 75 | #ifdef __cplusplus 76 | extern "C" { 77 | #endif 78 | 79 | typedef struct lhash_node_st 80 | { 81 | void *data; 82 | struct lhash_node_st *next; 83 | #ifndef OPENSSL_NO_HASH_COMP 84 | unsigned long hash; 85 | #endif 86 | } LHASH_NODE; 87 | 88 | typedef int (*LHASH_COMP_FN_TYPE)(const void *, const void *); 89 | typedef unsigned long (*LHASH_HASH_FN_TYPE)(const void *); 90 | typedef void (*LHASH_DOALL_FN_TYPE)(void *); 91 | typedef void (*LHASH_DOALL_ARG_FN_TYPE)(void *, void *); 92 | 93 | /* Macros for declaring and implementing type-safe wrappers for LHASH callbacks. 94 | * This way, callbacks can be provided to LHASH structures without function 95 | * pointer casting and the macro-defined callbacks provide per-variable casting 96 | * before deferring to the underlying type-specific callbacks. NB: It is 97 | * possible to place a "static" in front of both the DECLARE and IMPLEMENT 98 | * macros if the functions are strictly internal. */ 99 | 100 | /* First: "hash" functions */ 101 | #define DECLARE_LHASH_HASH_FN(f_name,o_type) \ 102 | unsigned long f_name##_LHASH_HASH(const void *); 103 | #define IMPLEMENT_LHASH_HASH_FN(f_name,o_type) \ 104 | unsigned long f_name##_LHASH_HASH(const void *arg) { \ 105 | o_type a = (o_type)arg; \ 106 | return f_name(a); } 107 | #define LHASH_HASH_FN(f_name) f_name##_LHASH_HASH 108 | 109 | /* Second: "compare" functions */ 110 | #define DECLARE_LHASH_COMP_FN(f_name,o_type) \ 111 | int f_name##_LHASH_COMP(const void *, const void *); 112 | #define IMPLEMENT_LHASH_COMP_FN(f_name,o_type) \ 113 | int f_name##_LHASH_COMP(const void *arg1, const void *arg2) { \ 114 | o_type a = (o_type)arg1; \ 115 | o_type b = (o_type)arg2; \ 116 | return f_name(a,b); } 117 | #define LHASH_COMP_FN(f_name) f_name##_LHASH_COMP 118 | 119 | /* Third: "doall" functions */ 120 | #define DECLARE_LHASH_DOALL_FN(f_name,o_type) \ 121 | void f_name##_LHASH_DOALL(void *); 122 | #define IMPLEMENT_LHASH_DOALL_FN(f_name,o_type) \ 123 | void f_name##_LHASH_DOALL(void *arg) { \ 124 | o_type a = (o_type)arg; \ 125 | f_name(a); } 126 | #define LHASH_DOALL_FN(f_name) f_name##_LHASH_DOALL 127 | 128 | /* Fourth: "doall_arg" functions */ 129 | #define DECLARE_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \ 130 | void f_name##_LHASH_DOALL_ARG(void *, void *); 131 | #define IMPLEMENT_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \ 132 | void f_name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \ 133 | o_type a = (o_type)arg1; \ 134 | a_type b = (a_type)arg2; \ 135 | f_name(a,b); } 136 | #define LHASH_DOALL_ARG_FN(f_name) f_name##_LHASH_DOALL_ARG 137 | 138 | typedef struct lhash_st 139 | { 140 | LHASH_NODE **b; 141 | LHASH_COMP_FN_TYPE comp; 142 | LHASH_HASH_FN_TYPE hash; 143 | unsigned int num_nodes; 144 | unsigned int num_alloc_nodes; 145 | unsigned int p; 146 | unsigned int pmax; 147 | unsigned long up_load; /* load times 256 */ 148 | unsigned long down_load; /* load times 256 */ 149 | unsigned long num_items; 150 | 151 | unsigned long num_expands; 152 | unsigned long num_expand_reallocs; 153 | unsigned long num_contracts; 154 | unsigned long num_contract_reallocs; 155 | unsigned long num_hash_calls; 156 | unsigned long num_comp_calls; 157 | unsigned long num_insert; 158 | unsigned long num_replace; 159 | unsigned long num_delete; 160 | unsigned long num_no_delete; 161 | unsigned long num_retrieve; 162 | unsigned long num_retrieve_miss; 163 | unsigned long num_hash_comps; 164 | 165 | int error; 166 | } LHASH; 167 | 168 | #define LH_LOAD_MULT 256 169 | 170 | /* Indicates a malloc() error in the last call, this is only bad 171 | * in lh_insert(). */ 172 | #define lh_error(lh) ((lh)->error) 173 | 174 | LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c); 175 | void lh_free(LHASH *lh); 176 | void *lh_insert(LHASH *lh, void *data); 177 | void *lh_delete(LHASH *lh, const void *data); 178 | void *lh_retrieve(LHASH *lh, const void *data); 179 | void lh_doall(LHASH *lh, LHASH_DOALL_FN_TYPE func); 180 | void lh_doall_arg(LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg); 181 | unsigned long lh_strhash(const char *c); 182 | unsigned long lh_num_items(const LHASH *lh); 183 | 184 | #ifndef OPENSSL_NO_FP_API 185 | void lh_stats(const LHASH *lh, FILE *out); 186 | void lh_node_stats(const LHASH *lh, FILE *out); 187 | void lh_node_usage_stats(const LHASH *lh, FILE *out); 188 | #endif 189 | 190 | #ifndef OPENSSL_NO_BIO 191 | void lh_stats_bio(const LHASH *lh, BIO *out); 192 | void lh_node_stats_bio(const LHASH *lh, BIO *out); 193 | void lh_node_usage_stats_bio(const LHASH *lh, BIO *out); 194 | #endif 195 | #ifdef __cplusplus 196 | } 197 | #endif 198 | 199 | #endif 200 | 201 | -------------------------------------------------------------------------------- /openssl/md2.h: -------------------------------------------------------------------------------- 1 | /* crypto/md/md2.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_MD2_H 60 | #define HEADER_MD2_H 61 | 62 | #include /* OPENSSL_NO_MD2, MD2_INT */ 63 | #ifdef OPENSSL_NO_MD2 64 | #error MD2 is disabled. 65 | #endif 66 | #include 67 | 68 | #define MD2_DIGEST_LENGTH 16 69 | #define MD2_BLOCK 16 70 | 71 | #ifdef __cplusplus 72 | extern "C" { 73 | #endif 74 | 75 | typedef struct MD2state_st 76 | { 77 | unsigned int num; 78 | unsigned char data[MD2_BLOCK]; 79 | MD2_INT cksm[MD2_BLOCK]; 80 | MD2_INT state[MD2_BLOCK]; 81 | } MD2_CTX; 82 | 83 | const char *MD2_options(void); 84 | int MD2_Init(MD2_CTX *c); 85 | int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); 86 | int MD2_Final(unsigned char *md, MD2_CTX *c); 87 | unsigned char *MD2(const unsigned char *d, size_t n,unsigned char *md); 88 | #ifdef __cplusplus 89 | } 90 | #endif 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /openssl/md4.h: -------------------------------------------------------------------------------- 1 | /* crypto/md4/md4.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_MD4_H 60 | #define HEADER_MD4_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | #ifdef OPENSSL_NO_MD4 70 | #error MD4 is disabled. 71 | #endif 72 | 73 | /* 74 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 75 | * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then ! 76 | * ! MD4_LONG_LOG2 has to be defined along. ! 77 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 78 | */ 79 | 80 | #if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) 81 | #define MD4_LONG unsigned long 82 | #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 83 | #define MD4_LONG unsigned long 84 | #define MD4_LONG_LOG2 3 85 | /* 86 | * _CRAY note. I could declare short, but I have no idea what impact 87 | * does it have on performance on none-T3E machines. I could declare 88 | * int, but at least on C90 sizeof(int) can be chosen at compile time. 89 | * So I've chosen long... 90 | * 91 | */ 92 | #else 93 | #define MD4_LONG unsigned int 94 | #endif 95 | 96 | #define MD4_CBLOCK 64 97 | #define MD4_LBLOCK (MD4_CBLOCK/4) 98 | #define MD4_DIGEST_LENGTH 16 99 | 100 | typedef struct MD4state_st 101 | { 102 | MD4_LONG A,B,C,D; 103 | MD4_LONG Nl,Nh; 104 | MD4_LONG data[MD4_LBLOCK]; 105 | unsigned int num; 106 | } MD4_CTX; 107 | 108 | int MD4_Init(MD4_CTX *c); 109 | int MD4_Update(MD4_CTX *c, const void *data, size_t len); 110 | int MD4_Final(unsigned char *md, MD4_CTX *c); 111 | unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); 112 | void MD4_Transform(MD4_CTX *c, const unsigned char *b); 113 | #ifdef __cplusplus 114 | } 115 | #endif 116 | 117 | #endif 118 | -------------------------------------------------------------------------------- /openssl/md5.h: -------------------------------------------------------------------------------- 1 | /* crypto/md5/md5.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_MD5_H 60 | #define HEADER_MD5_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | #ifdef OPENSSL_NO_MD5 70 | #error MD5 is disabled. 71 | #endif 72 | 73 | /* 74 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 75 | * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then ! 76 | * ! MD5_LONG_LOG2 has to be defined along. ! 77 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 78 | */ 79 | 80 | #if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) 81 | #define MD5_LONG unsigned long 82 | #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 83 | #define MD5_LONG unsigned long 84 | #define MD5_LONG_LOG2 3 85 | /* 86 | * _CRAY note. I could declare short, but I have no idea what impact 87 | * does it have on performance on none-T3E machines. I could declare 88 | * int, but at least on C90 sizeof(int) can be chosen at compile time. 89 | * So I've chosen long... 90 | * 91 | */ 92 | #else 93 | #define MD5_LONG unsigned int 94 | #endif 95 | 96 | #define MD5_CBLOCK 64 97 | #define MD5_LBLOCK (MD5_CBLOCK/4) 98 | #define MD5_DIGEST_LENGTH 16 99 | 100 | typedef struct MD5state_st 101 | { 102 | MD5_LONG A,B,C,D; 103 | MD5_LONG Nl,Nh; 104 | MD5_LONG data[MD5_LBLOCK]; 105 | unsigned int num; 106 | } MD5_CTX; 107 | 108 | int MD5_Init(MD5_CTX *c); 109 | int MD5_Update(MD5_CTX *c, const void *data, size_t len); 110 | int MD5_Final(unsigned char *md, MD5_CTX *c); 111 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); 112 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); 113 | #ifdef __cplusplus 114 | } 115 | #endif 116 | 117 | #endif 118 | -------------------------------------------------------------------------------- /openssl/opensslconf.h: -------------------------------------------------------------------------------- 1 | /* opensslconf.h */ 2 | /* WARNING: Generated automatically from opensslconf.h.in by Configure. */ 3 | 4 | /* OpenSSL was configured with the following options: */ 5 | #ifndef OPENSSL_SYSNAME_WIN32 6 | # define OPENSSL_SYSNAME_WIN32 7 | #endif 8 | #ifndef OPENSSL_DOING_MAKEDEPEND 9 | 10 | #ifndef OPENSSL_NO_CAMELLIA 11 | # define OPENSSL_NO_CAMELLIA 12 | #endif 13 | #ifndef OPENSSL_NO_GMP 14 | # define OPENSSL_NO_GMP 15 | #endif 16 | #ifndef OPENSSL_NO_KRB5 17 | # define OPENSSL_NO_KRB5 18 | #endif 19 | #ifndef OPENSSL_NO_MDC2 20 | # define OPENSSL_NO_MDC2 21 | #endif 22 | #ifndef OPENSSL_NO_RC5 23 | # define OPENSSL_NO_RC5 24 | #endif 25 | #ifndef OPENSSL_NO_RFC3779 26 | # define OPENSSL_NO_RFC3779 27 | #endif 28 | #ifndef OPENSSL_NO_SEED 29 | # define OPENSSL_NO_SEED 30 | #endif 31 | #ifndef OPENSSL_NO_TLSEXT 32 | # define OPENSSL_NO_TLSEXT 33 | #endif 34 | 35 | #endif /* OPENSSL_DOING_MAKEDEPEND */ 36 | #ifndef OPENSSL_THREADS 37 | # define OPENSSL_THREADS 38 | #endif 39 | 40 | /* The OPENSSL_NO_* macros are also defined as NO_* if the application 41 | asks for it. This is a transient feature that is provided for those 42 | who haven't had the time to do the appropriate changes in their 43 | applications. */ 44 | #ifdef OPENSSL_ALGORITHM_DEFINES 45 | # if defined(OPENSSL_NO_CAMELLIA) && !defined(NO_CAMELLIA) 46 | # define NO_CAMELLIA 47 | # endif 48 | # if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) 49 | # define NO_GMP 50 | # endif 51 | # if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) 52 | # define NO_KRB5 53 | # endif 54 | # if defined(OPENSSL_NO_MDC2) && !defined(NO_MDC2) 55 | # define NO_MDC2 56 | # endif 57 | # if defined(OPENSSL_NO_RC5) && !defined(NO_RC5) 58 | # define NO_RC5 59 | # endif 60 | # if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) 61 | # define NO_RFC3779 62 | # endif 63 | # if defined(OPENSSL_NO_SEED) && !defined(NO_SEED) 64 | # define NO_SEED 65 | # endif 66 | # if defined(OPENSSL_NO_TLSEXT) && !defined(NO_TLSEXT) 67 | # define NO_TLSEXT 68 | # endif 69 | #endif 70 | 71 | /* crypto/opensslconf.h.in */ 72 | 73 | /* Generate 80386 code? */ 74 | #undef I386_ONLY 75 | 76 | #if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ 77 | #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) 78 | #define ENGINESDIR "E:/openssl/lib/engines" 79 | #define OPENSSLDIR "E:/openssl/ssl" 80 | #endif 81 | #endif 82 | 83 | #undef OPENSSL_UNISTD 84 | #define OPENSSL_UNISTD 85 | 86 | #undef OPENSSL_EXPORT_VAR_AS_FUNCTION 87 | #define OPENSSL_EXPORT_VAR_AS_FUNCTION 88 | 89 | #if defined(HEADER_IDEA_H) && !defined(IDEA_INT) 90 | #define IDEA_INT unsigned int 91 | #endif 92 | 93 | #if defined(HEADER_MD2_H) && !defined(MD2_INT) 94 | #define MD2_INT unsigned int 95 | #endif 96 | 97 | #if defined(HEADER_RC2_H) && !defined(RC2_INT) 98 | /* I need to put in a mod for the alpha - eay */ 99 | #define RC2_INT unsigned int 100 | #endif 101 | 102 | #if defined(HEADER_RC4_H) 103 | #if !defined(RC4_INT) 104 | /* using int types make the structure larger but make the code faster 105 | * on most boxes I have tested - up to %20 faster. */ 106 | /* 107 | * I don't know what does "most" mean, but declaring "int" is a must on: 108 | * - Intel P6 because partial register stalls are very expensive; 109 | * - elder Alpha because it lacks byte load/store instructions; 110 | */ 111 | #define RC4_INT unsigned int 112 | #endif 113 | #if !defined(RC4_CHUNK) 114 | /* 115 | * This enables code handling data aligned at natural CPU word 116 | * boundary. See crypto/rc4/rc4_enc.c for further details. 117 | */ 118 | #undef RC4_CHUNK 119 | #endif 120 | #endif 121 | 122 | #if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) 123 | /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a 124 | * %20 speed up (longs are 8 bytes, int's are 4). */ 125 | #ifndef DES_LONG 126 | #define DES_LONG unsigned long 127 | #endif 128 | #endif 129 | 130 | #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) 131 | #define CONFIG_HEADER_BN_H 132 | #define BN_LLONG 133 | 134 | /* Should we define BN_DIV2W here? */ 135 | 136 | /* Only one for the following should be defined */ 137 | /* The prime number generation stuff may not work when 138 | * EIGHT_BIT but I don't care since I've only used this mode 139 | * for debuging the bignum libraries */ 140 | #undef SIXTY_FOUR_BIT_LONG 141 | #undef SIXTY_FOUR_BIT 142 | #define THIRTY_TWO_BIT 143 | #undef SIXTEEN_BIT 144 | #undef EIGHT_BIT 145 | #endif 146 | 147 | #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) 148 | #define CONFIG_HEADER_RC4_LOCL_H 149 | /* if this is defined data[i] is used instead of *data, this is a %20 150 | * speedup on x86 */ 151 | #define RC4_INDEX 152 | #endif 153 | 154 | #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 155 | #define CONFIG_HEADER_BF_LOCL_H 156 | #undef BF_PTR 157 | #endif /* HEADER_BF_LOCL_H */ 158 | 159 | #if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) 160 | #define CONFIG_HEADER_DES_LOCL_H 161 | #ifndef DES_DEFAULT_OPTIONS 162 | /* the following is tweaked from a config script, that is why it is a 163 | * protected undef/define */ 164 | #ifndef DES_PTR 165 | #undef DES_PTR 166 | #endif 167 | 168 | /* This helps C compiler generate the correct code for multiple functional 169 | * units. It reduces register dependancies at the expense of 2 more 170 | * registers */ 171 | #ifndef DES_RISC1 172 | #undef DES_RISC1 173 | #endif 174 | 175 | #ifndef DES_RISC2 176 | #undef DES_RISC2 177 | #endif 178 | 179 | #if defined(DES_RISC1) && defined(DES_RISC2) 180 | YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! 181 | #endif 182 | 183 | /* Unroll the inner loop, this sometimes helps, sometimes hinders. 184 | * Very mucy CPU dependant */ 185 | #ifndef DES_UNROLL 186 | #undef DES_UNROLL 187 | #endif 188 | 189 | /* These default values were supplied by 190 | * Peter Gutman 191 | * They are only used if nothing else has been defined */ 192 | #if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) 193 | /* Special defines which change the way the code is built depending on the 194 | CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find 195 | even newer MIPS CPU's, but at the moment one size fits all for 196 | optimization options. Older Sparc's work better with only UNROLL, but 197 | there's no way to tell at compile time what it is you're running on */ 198 | 199 | #if defined( sun ) /* Newer Sparc's */ 200 | # define DES_PTR 201 | # define DES_RISC1 202 | # define DES_UNROLL 203 | #elif defined( __ultrix ) /* Older MIPS */ 204 | # define DES_PTR 205 | # define DES_RISC2 206 | # define DES_UNROLL 207 | #elif defined( __osf1__ ) /* Alpha */ 208 | # define DES_PTR 209 | # define DES_RISC2 210 | #elif defined ( _AIX ) /* RS6000 */ 211 | /* Unknown */ 212 | #elif defined( __hpux ) /* HP-PA */ 213 | /* Unknown */ 214 | #elif defined( __aux ) /* 68K */ 215 | /* Unknown */ 216 | #elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ 217 | # define DES_UNROLL 218 | #elif defined( __sgi ) /* Newer MIPS */ 219 | # define DES_PTR 220 | # define DES_RISC2 221 | # define DES_UNROLL 222 | #elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ 223 | # define DES_PTR 224 | # define DES_RISC1 225 | # define DES_UNROLL 226 | #endif /* Systems-specific speed defines */ 227 | #endif 228 | 229 | #endif /* DES_DEFAULT_OPTIONS */ 230 | #endif /* HEADER_DES_LOCL_H */ 231 | -------------------------------------------------------------------------------- /openssl/opensslv.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_OPENSSLV_H 2 | #define HEADER_OPENSSLV_H 3 | 4 | /* Numeric release version identifier: 5 | * MNNFFPPS: major minor fix patch status 6 | * The status nibble has one of the values 0 for development, 1 to e for betas 7 | * 1 to 14, and f for release. The patch level is exactly that. 8 | * For example: 9 | * 0.9.3-dev 0x00903000 10 | * 0.9.3-beta1 0x00903001 11 | * 0.9.3-beta2-dev 0x00903002 12 | * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) 13 | * 0.9.3 0x0090300f 14 | * 0.9.3a 0x0090301f 15 | * 0.9.4 0x0090400f 16 | * 1.2.3z 0x102031af 17 | * 18 | * For continuity reasons (because 0.9.5 is already out, and is coded 19 | * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level 20 | * part is slightly different, by setting the highest bit. This means 21 | * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start 22 | * with 0x0090600S... 23 | * 24 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) 25 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for 26 | * major minor fix final patch/beta) 27 | */ 28 | #define OPENSSL_VERSION_NUMBER 0x0090807fL 29 | #ifdef OPENSSL_FIPS 30 | #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8g-fips 19 Oct 2007" 31 | #else 32 | #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8g 19 Oct 2007" 33 | #endif 34 | #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT 35 | 36 | 37 | /* The macros below are to be used for shared library (.so, .dll, ...) 38 | * versioning. That kind of versioning works a bit differently between 39 | * operating systems. The most usual scheme is to set a major and a minor 40 | * number, and have the runtime loader check that the major number is equal 41 | * to what it was at application link time, while the minor number has to 42 | * be greater or equal to what it was at application link time. With this 43 | * scheme, the version number is usually part of the file name, like this: 44 | * 45 | * libcrypto.so.0.9 46 | * 47 | * Some unixen also make a softlink with the major verson number only: 48 | * 49 | * libcrypto.so.0 50 | * 51 | * On Tru64 and IRIX 6.x it works a little bit differently. There, the 52 | * shared library version is stored in the file, and is actually a series 53 | * of versions, separated by colons. The rightmost version present in the 54 | * library when linking an application is stored in the application to be 55 | * matched at run time. When the application is run, a check is done to 56 | * see if the library version stored in the application matches any of the 57 | * versions in the version string of the library itself. 58 | * This version string can be constructed in any way, depending on what 59 | * kind of matching is desired. However, to implement the same scheme as 60 | * the one used in the other unixen, all compatible versions, from lowest 61 | * to highest, should be part of the string. Consecutive builds would 62 | * give the following versions strings: 63 | * 64 | * 3.0 65 | * 3.0:3.1 66 | * 3.0:3.1:3.2 67 | * 4.0 68 | * 4.0:4.1 69 | * 70 | * Notice how version 4 is completely incompatible with version, and 71 | * therefore give the breach you can see. 72 | * 73 | * There may be other schemes as well that I haven't yet discovered. 74 | * 75 | * So, here's the way it works here: first of all, the library version 76 | * number doesn't need at all to match the overall OpenSSL version. 77 | * However, it's nice and more understandable if it actually does. 78 | * The current library version is stored in the macro SHLIB_VERSION_NUMBER, 79 | * which is just a piece of text in the format "M.m.e" (Major, minor, edit). 80 | * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, 81 | * we need to keep a history of version numbers, which is done in the 82 | * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and 83 | * should only keep the versions that are binary compatible with the current. 84 | */ 85 | #define SHLIB_VERSION_HISTORY "" 86 | #define SHLIB_VERSION_NUMBER "0.9.8" 87 | 88 | 89 | #endif /* HEADER_OPENSSLV_H */ 90 | -------------------------------------------------------------------------------- /openssl/ossl_typ.h: -------------------------------------------------------------------------------- 1 | /* ==================================================================== 2 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * 3. All advertising materials mentioning features or use of this 17 | * software must display the following acknowledgment: 18 | * "This product includes software developed by the OpenSSL Project 19 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 20 | * 21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 22 | * endorse or promote products derived from this software without 23 | * prior written permission. For written permission, please contact 24 | * openssl-core@openssl.org. 25 | * 26 | * 5. Products derived from this software may not be called "OpenSSL" 27 | * nor may "OpenSSL" appear in their names without prior written 28 | * permission of the OpenSSL Project. 29 | * 30 | * 6. Redistributions of any form whatsoever must retain the following 31 | * acknowledgment: 32 | * "This product includes software developed by the OpenSSL Project 33 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 46 | * OF THE POSSIBILITY OF SUCH DAMAGE. 47 | * ==================================================================== 48 | * 49 | * This product includes cryptographic software written by Eric Young 50 | * (eay@cryptsoft.com). This product includes software written by Tim 51 | * Hudson (tjh@cryptsoft.com). 52 | * 53 | */ 54 | 55 | #ifndef HEADER_OPENSSL_TYPES_H 56 | #define HEADER_OPENSSL_TYPES_H 57 | 58 | #include 59 | 60 | #ifdef NO_ASN1_TYPEDEFS 61 | #define ASN1_INTEGER ASN1_STRING 62 | #define ASN1_ENUMERATED ASN1_STRING 63 | #define ASN1_BIT_STRING ASN1_STRING 64 | #define ASN1_OCTET_STRING ASN1_STRING 65 | #define ASN1_PRINTABLESTRING ASN1_STRING 66 | #define ASN1_T61STRING ASN1_STRING 67 | #define ASN1_IA5STRING ASN1_STRING 68 | #define ASN1_UTCTIME ASN1_STRING 69 | #define ASN1_GENERALIZEDTIME ASN1_STRING 70 | #define ASN1_TIME ASN1_STRING 71 | #define ASN1_GENERALSTRING ASN1_STRING 72 | #define ASN1_UNIVERSALSTRING ASN1_STRING 73 | #define ASN1_BMPSTRING ASN1_STRING 74 | #define ASN1_VISIBLESTRING ASN1_STRING 75 | #define ASN1_UTF8STRING ASN1_STRING 76 | #define ASN1_BOOLEAN int 77 | #define ASN1_NULL int 78 | #else 79 | typedef struct asn1_string_st ASN1_INTEGER; 80 | typedef struct asn1_string_st ASN1_ENUMERATED; 81 | typedef struct asn1_string_st ASN1_BIT_STRING; 82 | typedef struct asn1_string_st ASN1_OCTET_STRING; 83 | typedef struct asn1_string_st ASN1_PRINTABLESTRING; 84 | typedef struct asn1_string_st ASN1_T61STRING; 85 | typedef struct asn1_string_st ASN1_IA5STRING; 86 | typedef struct asn1_string_st ASN1_GENERALSTRING; 87 | typedef struct asn1_string_st ASN1_UNIVERSALSTRING; 88 | typedef struct asn1_string_st ASN1_BMPSTRING; 89 | typedef struct asn1_string_st ASN1_UTCTIME; 90 | typedef struct asn1_string_st ASN1_TIME; 91 | typedef struct asn1_string_st ASN1_GENERALIZEDTIME; 92 | typedef struct asn1_string_st ASN1_VISIBLESTRING; 93 | typedef struct asn1_string_st ASN1_UTF8STRING; 94 | typedef int ASN1_BOOLEAN; 95 | typedef int ASN1_NULL; 96 | #endif 97 | 98 | #ifdef OPENSSL_SYS_WIN32 99 | #undef X509_NAME 100 | #undef X509_CERT_PAIR 101 | #undef PKCS7_ISSUER_AND_SERIAL 102 | #endif 103 | 104 | #ifdef BIGNUM 105 | #undef BIGNUM 106 | #endif 107 | typedef struct bignum_st BIGNUM; 108 | typedef struct bignum_ctx BN_CTX; 109 | typedef struct bn_blinding_st BN_BLINDING; 110 | typedef struct bn_mont_ctx_st BN_MONT_CTX; 111 | typedef struct bn_recp_ctx_st BN_RECP_CTX; 112 | typedef struct bn_gencb_st BN_GENCB; 113 | 114 | typedef struct buf_mem_st BUF_MEM; 115 | 116 | typedef struct evp_cipher_st EVP_CIPHER; 117 | typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; 118 | typedef struct env_md_st EVP_MD; 119 | typedef struct env_md_ctx_st EVP_MD_CTX; 120 | typedef struct evp_pkey_st EVP_PKEY; 121 | 122 | typedef struct dh_st DH; 123 | typedef struct dh_method DH_METHOD; 124 | 125 | typedef struct dsa_st DSA; 126 | typedef struct dsa_method DSA_METHOD; 127 | 128 | typedef struct rsa_st RSA; 129 | typedef struct rsa_meth_st RSA_METHOD; 130 | 131 | typedef struct rand_meth_st RAND_METHOD; 132 | 133 | typedef struct ecdh_method ECDH_METHOD; 134 | typedef struct ecdsa_method ECDSA_METHOD; 135 | 136 | typedef struct x509_st X509; 137 | typedef struct X509_algor_st X509_ALGOR; 138 | typedef struct X509_crl_st X509_CRL; 139 | typedef struct X509_name_st X509_NAME; 140 | typedef struct x509_store_st X509_STORE; 141 | typedef struct x509_store_ctx_st X509_STORE_CTX; 142 | 143 | typedef struct v3_ext_ctx X509V3_CTX; 144 | typedef struct conf_st CONF; 145 | 146 | typedef struct store_st STORE; 147 | typedef struct store_method_st STORE_METHOD; 148 | 149 | typedef struct ui_st UI; 150 | typedef struct ui_method_st UI_METHOD; 151 | 152 | typedef struct st_ERR_FNS ERR_FNS; 153 | 154 | typedef struct engine_st ENGINE; 155 | 156 | typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; 157 | typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; 158 | typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; 159 | typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE; 160 | 161 | /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */ 162 | #define DECLARE_PKCS12_STACK_OF(type) /* Nothing */ 163 | #define IMPLEMENT_PKCS12_STACK_OF(type) /* Nothing */ 164 | 165 | typedef struct crypto_ex_data_st CRYPTO_EX_DATA; 166 | /* Callback types for crypto.h */ 167 | typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, 168 | int idx, long argl, void *argp); 169 | typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, 170 | int idx, long argl, void *argp); 171 | typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, 172 | int idx, long argl, void *argp); 173 | 174 | #endif /* def HEADER_OPENSSL_TYPES_H */ 175 | -------------------------------------------------------------------------------- /openssl/pem2.h: -------------------------------------------------------------------------------- 1 | /* ==================================================================== 2 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * 3. All advertising materials mentioning features or use of this 17 | * software must display the following acknowledgment: 18 | * "This product includes software developed by the OpenSSL Project 19 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 20 | * 21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 22 | * endorse or promote products derived from this software without 23 | * prior written permission. For written permission, please contact 24 | * licensing@OpenSSL.org. 25 | * 26 | * 5. Products derived from this software may not be called "OpenSSL" 27 | * nor may "OpenSSL" appear in their names without prior written 28 | * permission of the OpenSSL Project. 29 | * 30 | * 6. Redistributions of any form whatsoever must retain the following 31 | * acknowledgment: 32 | * "This product includes software developed by the OpenSSL Project 33 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 46 | * OF THE POSSIBILITY OF SUCH DAMAGE. 47 | * ==================================================================== 48 | * 49 | * This product includes cryptographic software written by Eric Young 50 | * (eay@cryptsoft.com). This product includes software written by Tim 51 | * Hudson (tjh@cryptsoft.com). 52 | * 53 | */ 54 | 55 | /* 56 | * This header only exists to break a circular dependency between pem and err 57 | * Ben 30 Jan 1999. 58 | */ 59 | 60 | #ifdef __cplusplus 61 | extern "C" { 62 | #endif 63 | 64 | #ifndef HEADER_PEM_H 65 | void ERR_load_PEM_strings(void); 66 | #endif 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /openssl/pq_compat.h: -------------------------------------------------------------------------------- 1 | /* crypto/pqueue/pqueue_compat.h */ 2 | /* 3 | * DTLS implementation written by Nagendra Modadugu 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * openssl-core@OpenSSL.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | 60 | #include 61 | #include 62 | 63 | /* 64 | * The purpose of this header file is for supporting 64-bit integer 65 | * manipulation on 32-bit (and lower) machines. Currently the only 66 | * such environment is VMS, Utrix and those with smaller default integer 67 | * sizes than 32 bits. For all such environment, we fall back to using 68 | * BIGNUM. We may need to fine tune the conditions for systems that 69 | * are incorrectly configured. 70 | * 71 | * The only clients of this code are (1) pqueue for priority, and 72 | * (2) DTLS, for sequence number manipulation. 73 | */ 74 | 75 | #if (defined(THIRTY_TWO_BIT) && !defined(BN_LLONG)) || defined(SIXTEEN_BIT) || defined(EIGHT_BIT) 76 | 77 | #define PQ_64BIT_IS_INTEGER 0 78 | #define PQ_64BIT_IS_BIGNUM 1 79 | 80 | #define PQ_64BIT BIGNUM 81 | #define PQ_64BIT_CTX BN_CTX 82 | 83 | #define pq_64bit_init(x) BN_init(x) 84 | #define pq_64bit_free(x) BN_free(x) 85 | 86 | #define pq_64bit_ctx_new(ctx) BN_CTX_new() 87 | #define pq_64bit_ctx_free(x) BN_CTX_free(x) 88 | 89 | #define pq_64bit_assign(x, y) BN_copy(x, y) 90 | #define pq_64bit_assign_word(x, y) BN_set_word(x, y) 91 | #define pq_64bit_gt(x, y) BN_ucmp(x, y) >= 1 ? 1 : 0 92 | #define pq_64bit_eq(x, y) BN_ucmp(x, y) == 0 ? 1 : 0 93 | #define pq_64bit_add_word(x, w) BN_add_word(x, w) 94 | #define pq_64bit_sub(r, x, y) BN_sub(r, x, y) 95 | #define pq_64bit_sub_word(x, w) BN_sub_word(x, w) 96 | #define pq_64bit_mod(r, x, n, ctx) BN_mod(r, x, n, ctx) 97 | 98 | #define pq_64bit_bin2num(bn, bytes, len) BN_bin2bn(bytes, len, bn) 99 | #define pq_64bit_num2bin(bn, bytes) BN_bn2bin(bn, bytes) 100 | #define pq_64bit_get_word(x) BN_get_word(x) 101 | #define pq_64bit_is_bit_set(x, offset) BN_is_bit_set(x, offset) 102 | #define pq_64bit_lshift(r, x, shift) BN_lshift(r, x, shift) 103 | #define pq_64bit_set_bit(x, num) BN_set_bit(x, num) 104 | #define pq_64bit_get_length(x) BN_num_bits((x)) 105 | 106 | #else 107 | 108 | #define PQ_64BIT_IS_INTEGER 1 109 | #define PQ_64BIT_IS_BIGNUM 0 110 | 111 | #if defined(SIXTY_FOUR_BIT) 112 | #define PQ_64BIT BN_ULONG 113 | #define PQ_64BIT_PRINT "%lld" 114 | #elif defined(SIXTY_FOUR_BIT_LONG) 115 | #define PQ_64BIT BN_ULONG 116 | #define PQ_64BIT_PRINT "%ld" 117 | #elif defined(THIRTY_TWO_BIT) 118 | #define PQ_64BIT BN_ULLONG 119 | #define PQ_64BIT_PRINT "%lld" 120 | #endif 121 | 122 | #define PQ_64BIT_CTX void 123 | 124 | #define pq_64bit_init(x) 125 | #define pq_64bit_free(x) 126 | #define pq_64bit_ctx_new(ctx) (ctx) 127 | #define pq_64bit_ctx_free(x) 128 | 129 | #define pq_64bit_assign(x, y) (*(x) = *(y)) 130 | #define pq_64bit_assign_word(x, y) (*(x) = y) 131 | #define pq_64bit_gt(x, y) (*(x) > *(y)) 132 | #define pq_64bit_eq(x, y) (*(x) == *(y)) 133 | #define pq_64bit_add_word(x, w) (*(x) = (*(x) + (w))) 134 | #define pq_64bit_sub(r, x, y) (*(r) = (*(x) - *(y))) 135 | #define pq_64bit_sub_word(x, w) (*(x) = (*(x) - (w))) 136 | #define pq_64bit_mod(r, x, n, ctx) 137 | 138 | #define pq_64bit_bin2num(num, bytes, len) bytes_to_long_long(bytes, num) 139 | #define pq_64bit_num2bin(num, bytes) long_long_to_bytes(num, bytes) 140 | #define pq_64bit_get_word(x) *(x) 141 | #define pq_64bit_lshift(r, x, shift) (*(r) = (*(x) << (shift))) 142 | #define pq_64bit_set_bit(x, num) do { \ 143 | PQ_64BIT mask = 1; \ 144 | mask = mask << (num); \ 145 | *(x) |= mask; \ 146 | } while(0) 147 | #endif /* OPENSSL_SYS_VMS */ 148 | -------------------------------------------------------------------------------- /openssl/pqueue.h: -------------------------------------------------------------------------------- 1 | /* crypto/pqueue/pqueue.h */ 2 | /* 3 | * DTLS implementation written by Nagendra Modadugu 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * openssl-core@OpenSSL.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | 60 | #ifndef HEADER_PQUEUE_H 61 | #define HEADER_PQUEUE_H 62 | 63 | #include 64 | #include 65 | #include 66 | 67 | #include 68 | 69 | typedef struct _pqueue *pqueue; 70 | 71 | typedef struct _pitem 72 | { 73 | PQ_64BIT priority; 74 | void *data; 75 | struct _pitem *next; 76 | } pitem; 77 | 78 | typedef struct _pitem *piterator; 79 | 80 | pitem *pitem_new(PQ_64BIT priority, void *data); 81 | void pitem_free(pitem *item); 82 | 83 | pqueue pqueue_new(void); 84 | void pqueue_free(pqueue pq); 85 | 86 | pitem *pqueue_insert(pqueue pq, pitem *item); 87 | pitem *pqueue_peek(pqueue pq); 88 | pitem *pqueue_pop(pqueue pq); 89 | pitem *pqueue_find(pqueue pq, PQ_64BIT priority); 90 | pitem *pqueue_iterator(pqueue pq); 91 | pitem *pqueue_next(piterator *iter); 92 | 93 | void pqueue_print(pqueue pq); 94 | 95 | #endif /* ! HEADER_PQUEUE_H */ 96 | -------------------------------------------------------------------------------- /openssl/rand.h: -------------------------------------------------------------------------------- 1 | /* crypto/rand/rand.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RAND_H 60 | #define HEADER_RAND_H 61 | 62 | #include 63 | #include 64 | #include 65 | 66 | #if defined(OPENSSL_SYS_WINDOWS) 67 | #include 68 | #endif 69 | 70 | #ifdef __cplusplus 71 | extern "C" { 72 | #endif 73 | 74 | #if defined(OPENSSL_FIPS) 75 | #define FIPS_RAND_SIZE_T size_t 76 | #endif 77 | 78 | /* Already defined in ossl_typ.h */ 79 | /* typedef struct rand_meth_st RAND_METHOD; */ 80 | 81 | struct rand_meth_st 82 | { 83 | void (*seed)(const void *buf, int num); 84 | int (*bytes)(unsigned char *buf, int num); 85 | void (*cleanup)(void); 86 | void (*add)(const void *buf, int num, double entropy); 87 | int (*pseudorand)(unsigned char *buf, int num); 88 | int (*status)(void); 89 | }; 90 | 91 | #ifdef BN_DEBUG 92 | extern int rand_predictable; 93 | #endif 94 | 95 | int RAND_set_rand_method(const RAND_METHOD *meth); 96 | const RAND_METHOD *RAND_get_rand_method(void); 97 | #ifndef OPENSSL_NO_ENGINE 98 | int RAND_set_rand_engine(ENGINE *engine); 99 | #endif 100 | RAND_METHOD *RAND_SSLeay(void); 101 | void RAND_cleanup(void ); 102 | int RAND_bytes(unsigned char *buf,int num); 103 | int RAND_pseudo_bytes(unsigned char *buf,int num); 104 | void RAND_seed(const void *buf,int num); 105 | void RAND_add(const void *buf,int num,double entropy); 106 | int RAND_load_file(const char *file,long max_bytes); 107 | int RAND_write_file(const char *file); 108 | const char *RAND_file_name(char *file,size_t num); 109 | int RAND_status(void); 110 | int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); 111 | int RAND_egd(const char *path); 112 | int RAND_egd_bytes(const char *path,int bytes); 113 | int RAND_poll(void); 114 | 115 | #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) 116 | 117 | void RAND_screen(void); 118 | int RAND_event(UINT, WPARAM, LPARAM); 119 | 120 | #endif 121 | 122 | /* BEGIN ERROR CODES */ 123 | /* The following lines are auto generated by the script mkerr.pl. Any changes 124 | * made after this point may be overwritten when the script is next run. 125 | */ 126 | void ERR_load_RAND_strings(void); 127 | 128 | /* Error codes for the RAND functions. */ 129 | 130 | /* Function codes. */ 131 | #define RAND_F_RAND_GET_RAND_METHOD 101 132 | #define RAND_F_SSLEAY_RAND_BYTES 100 133 | 134 | /* Reason codes. */ 135 | #define RAND_R_PRNG_NOT_SEEDED 100 136 | 137 | #ifdef __cplusplus 138 | } 139 | #endif 140 | #endif 141 | -------------------------------------------------------------------------------- /openssl/rc2.h: -------------------------------------------------------------------------------- 1 | /* crypto/rc2/rc2.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RC2_H 60 | #define HEADER_RC2_H 61 | 62 | #include /* OPENSSL_NO_RC2, RC2_INT */ 63 | #ifdef OPENSSL_NO_RC2 64 | #error RC2 is disabled. 65 | #endif 66 | 67 | #define RC2_ENCRYPT 1 68 | #define RC2_DECRYPT 0 69 | 70 | #define RC2_BLOCK 8 71 | #define RC2_KEY_LENGTH 16 72 | 73 | #ifdef __cplusplus 74 | extern "C" { 75 | #endif 76 | 77 | typedef struct rc2_key_st 78 | { 79 | RC2_INT data[64]; 80 | } RC2_KEY; 81 | 82 | 83 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); 84 | void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, 85 | int enc); 86 | void RC2_encrypt(unsigned long *data,RC2_KEY *key); 87 | void RC2_decrypt(unsigned long *data,RC2_KEY *key); 88 | void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 89 | RC2_KEY *ks, unsigned char *iv, int enc); 90 | void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, 91 | long length, RC2_KEY *schedule, unsigned char *ivec, 92 | int *num, int enc); 93 | void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, 94 | long length, RC2_KEY *schedule, unsigned char *ivec, 95 | int *num); 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /openssl/rc4.h: -------------------------------------------------------------------------------- 1 | /* crypto/rc4/rc4.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RC4_H 60 | #define HEADER_RC4_H 61 | 62 | #include /* OPENSSL_NO_RC4, RC4_INT */ 63 | #ifdef OPENSSL_NO_RC4 64 | #error RC4 is disabled. 65 | #endif 66 | 67 | #ifdef __cplusplus 68 | extern "C" { 69 | #endif 70 | 71 | typedef struct rc4_key_st 72 | { 73 | RC4_INT x,y; 74 | RC4_INT data[256]; 75 | } RC4_KEY; 76 | 77 | 78 | const char *RC4_options(void); 79 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 80 | void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata, 81 | unsigned char *outdata); 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /openssl/ripemd.h: -------------------------------------------------------------------------------- 1 | /* crypto/ripemd/ripemd.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RIPEMD_H 60 | #define HEADER_RIPEMD_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | #ifdef OPENSSL_NO_RIPEMD 70 | #error RIPEMD is disabled. 71 | #endif 72 | 73 | #if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) 74 | #define RIPEMD160_LONG unsigned long 75 | #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 76 | #define RIPEMD160_LONG unsigned long 77 | #define RIPEMD160_LONG_LOG2 3 78 | #else 79 | #define RIPEMD160_LONG unsigned int 80 | #endif 81 | 82 | #define RIPEMD160_CBLOCK 64 83 | #define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) 84 | #define RIPEMD160_DIGEST_LENGTH 20 85 | 86 | typedef struct RIPEMD160state_st 87 | { 88 | RIPEMD160_LONG A,B,C,D,E; 89 | RIPEMD160_LONG Nl,Nh; 90 | RIPEMD160_LONG data[RIPEMD160_LBLOCK]; 91 | unsigned int num; 92 | } RIPEMD160_CTX; 93 | 94 | int RIPEMD160_Init(RIPEMD160_CTX *c); 95 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); 96 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); 97 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, 98 | unsigned char *md); 99 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); 100 | #ifdef __cplusplus 101 | } 102 | #endif 103 | 104 | #endif 105 | -------------------------------------------------------------------------------- /openssl/sha.h: -------------------------------------------------------------------------------- 1 | /* crypto/sha/sha.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_SHA_H 60 | #define HEADER_SHA_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | #if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1)) 70 | #error SHA is disabled. 71 | #endif 72 | 73 | #if defined(OPENSSL_FIPS) 74 | #define FIPS_SHA_SIZE_T size_t 75 | #endif 76 | 77 | /* 78 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 79 | * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then ! 80 | * ! SHA_LONG_LOG2 has to be defined along. ! 81 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 82 | */ 83 | 84 | #if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) 85 | #define SHA_LONG unsigned long 86 | #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) 87 | #define SHA_LONG unsigned long 88 | #define SHA_LONG_LOG2 3 89 | #else 90 | #define SHA_LONG unsigned int 91 | #endif 92 | 93 | #define SHA_LBLOCK 16 94 | #define SHA_CBLOCK (SHA_LBLOCK*4) /* SHA treats input data as a 95 | * contiguous array of 32 bit 96 | * wide big-endian values. */ 97 | #define SHA_LAST_BLOCK (SHA_CBLOCK-8) 98 | #define SHA_DIGEST_LENGTH 20 99 | 100 | typedef struct SHAstate_st 101 | { 102 | SHA_LONG h0,h1,h2,h3,h4; 103 | SHA_LONG Nl,Nh; 104 | SHA_LONG data[SHA_LBLOCK]; 105 | unsigned int num; 106 | } SHA_CTX; 107 | 108 | #ifndef OPENSSL_NO_SHA0 109 | int SHA_Init(SHA_CTX *c); 110 | int SHA_Update(SHA_CTX *c, const void *data, size_t len); 111 | int SHA_Final(unsigned char *md, SHA_CTX *c); 112 | unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md); 113 | void SHA_Transform(SHA_CTX *c, const unsigned char *data); 114 | #endif 115 | #ifndef OPENSSL_NO_SHA1 116 | int SHA1_Init(SHA_CTX *c); 117 | int SHA1_Update(SHA_CTX *c, const void *data, size_t len); 118 | int SHA1_Final(unsigned char *md, SHA_CTX *c); 119 | unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); 120 | void SHA1_Transform(SHA_CTX *c, const unsigned char *data); 121 | #endif 122 | 123 | #define SHA256_CBLOCK (SHA_LBLOCK*4) /* SHA-256 treats input data as a 124 | * contiguous array of 32 bit 125 | * wide big-endian values. */ 126 | #define SHA224_DIGEST_LENGTH 28 127 | #define SHA256_DIGEST_LENGTH 32 128 | 129 | typedef struct SHA256state_st 130 | { 131 | SHA_LONG h[8]; 132 | SHA_LONG Nl,Nh; 133 | SHA_LONG data[SHA_LBLOCK]; 134 | unsigned int num,md_len; 135 | } SHA256_CTX; 136 | 137 | #ifndef OPENSSL_NO_SHA256 138 | int SHA224_Init(SHA256_CTX *c); 139 | int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); 140 | int SHA224_Final(unsigned char *md, SHA256_CTX *c); 141 | unsigned char *SHA224(const unsigned char *d, size_t n,unsigned char *md); 142 | int SHA256_Init(SHA256_CTX *c); 143 | int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); 144 | int SHA256_Final(unsigned char *md, SHA256_CTX *c); 145 | unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md); 146 | void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); 147 | #endif 148 | 149 | #define SHA384_DIGEST_LENGTH 48 150 | #define SHA512_DIGEST_LENGTH 64 151 | 152 | #ifndef OPENSSL_NO_SHA512 153 | /* 154 | * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64 155 | * being exactly 64-bit wide. See Implementation Notes in sha512.c 156 | * for further details. 157 | */ 158 | #define SHA512_CBLOCK (SHA_LBLOCK*8) /* SHA-512 treats input data as a 159 | * contiguous array of 64 bit 160 | * wide big-endian values. */ 161 | #if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) 162 | #define SHA_LONG64 unsigned __int64 163 | #define U64(C) C##UI64 164 | #elif defined(__arch64__) 165 | #define SHA_LONG64 unsigned long 166 | #define U64(C) C##UL 167 | #else 168 | #define SHA_LONG64 unsigned long long 169 | #define U64(C) C##ULL 170 | #endif 171 | 172 | typedef struct SHA512state_st 173 | { 174 | SHA_LONG64 h[8]; 175 | SHA_LONG64 Nl,Nh; 176 | union { 177 | SHA_LONG64 d[SHA_LBLOCK]; 178 | unsigned char p[SHA512_CBLOCK]; 179 | } u; 180 | unsigned int num,md_len; 181 | } SHA512_CTX; 182 | #endif 183 | 184 | #ifndef OPENSSL_NO_SHA512 185 | int SHA384_Init(SHA512_CTX *c); 186 | int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); 187 | int SHA384_Final(unsigned char *md, SHA512_CTX *c); 188 | unsigned char *SHA384(const unsigned char *d, size_t n,unsigned char *md); 189 | int SHA512_Init(SHA512_CTX *c); 190 | int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); 191 | int SHA512_Final(unsigned char *md, SHA512_CTX *c); 192 | unsigned char *SHA512(const unsigned char *d, size_t n,unsigned char *md); 193 | void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); 194 | #endif 195 | 196 | #ifdef __cplusplus 197 | } 198 | #endif 199 | 200 | #endif 201 | -------------------------------------------------------------------------------- /openssl/ssl23.h: -------------------------------------------------------------------------------- 1 | /* ssl/ssl23.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_SSL23_H 60 | #define HEADER_SSL23_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | /*client */ 67 | /* write to server */ 68 | #define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT) 69 | #define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT) 70 | /* read from server */ 71 | #define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT) 72 | #define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT) 73 | 74 | /* server */ 75 | /* read from client */ 76 | #define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT) 77 | #define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT) 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #endif 83 | 84 | -------------------------------------------------------------------------------- /openssl/stack.h: -------------------------------------------------------------------------------- 1 | /* crypto/stack/stack.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_STACK_H 60 | #define HEADER_STACK_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | typedef struct stack_st 67 | { 68 | int num; 69 | char **data; 70 | int sorted; 71 | 72 | int num_alloc; 73 | int (*comp)(const char * const *, const char * const *); 74 | } STACK; 75 | 76 | #define M_sk_num(sk) ((sk) ? (sk)->num:-1) 77 | #define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) 78 | 79 | int sk_num(const STACK *); 80 | char *sk_value(const STACK *, int); 81 | 82 | char *sk_set(STACK *, int, char *); 83 | 84 | STACK *sk_new(int (*cmp)(const char * const *, const char * const *)); 85 | STACK *sk_new_null(void); 86 | void sk_free(STACK *); 87 | void sk_pop_free(STACK *st, void (*func)(void *)); 88 | int sk_insert(STACK *sk,char *data,int where); 89 | char *sk_delete(STACK *st,int loc); 90 | char *sk_delete_ptr(STACK *st, char *p); 91 | int sk_find(STACK *st,char *data); 92 | int sk_find_ex(STACK *st,char *data); 93 | int sk_push(STACK *st,char *data); 94 | int sk_unshift(STACK *st,char *data); 95 | char *sk_shift(STACK *st); 96 | char *sk_pop(STACK *st); 97 | void sk_zero(STACK *st); 98 | int (*sk_set_cmp_func(STACK *sk, int (*c)(const char * const *, 99 | const char * const *))) 100 | (const char * const *, const char * const *); 101 | STACK *sk_dup(STACK *st); 102 | void sk_sort(STACK *st); 103 | int sk_is_sorted(const STACK *st); 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /openssl/tmdiff.h: -------------------------------------------------------------------------------- 1 | /* crypto/tmdiff.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | /* Header for dynamic hash table routines 60 | * Author - Eric Young 61 | */ 62 | /* ... erm yeah, "dynamic hash tables" you say? 63 | * 64 | * And what would dynamic hash tables have to do with any of this code *now*? 65 | * AFAICS, this code is only referenced by crypto/bn/exp.c which is an unused 66 | * file that I doubt compiles any more. speed.c is the only thing that could 67 | * use this (and it has nothing to do with hash tables), yet it instead has its 68 | * own duplication of all this stuff and looks, if anything, more complete. See 69 | * the corresponding note in apps/speed.c. 70 | * The Bemused - Geoff 71 | */ 72 | 73 | #ifndef HEADER_TMDIFF_H 74 | #define HEADER_TMDIFF_H 75 | 76 | #ifdef __cplusplus 77 | extern "C" { 78 | #endif 79 | 80 | typedef struct ms_tm MS_TM; 81 | 82 | MS_TM *ms_time_new(void ); 83 | void ms_time_free(MS_TM *a); 84 | void ms_time_get(MS_TM *a); 85 | double ms_time_diff(MS_TM *start, MS_TM *end); 86 | int ms_time_cmp(const MS_TM *ap, const MS_TM *bp); 87 | 88 | #ifdef __cplusplus 89 | } 90 | #endif 91 | 92 | #endif 93 | 94 | -------------------------------------------------------------------------------- /openssl/txt_db.h: -------------------------------------------------------------------------------- 1 | /* crypto/txt_db/txt_db.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_TXT_DB_H 60 | #define HEADER_TXT_DB_H 61 | 62 | #include 63 | #ifndef OPENSSL_NO_BIO 64 | #include 65 | #endif 66 | #include 67 | #include 68 | 69 | #define DB_ERROR_OK 0 70 | #define DB_ERROR_MALLOC 1 71 | #define DB_ERROR_INDEX_CLASH 2 72 | #define DB_ERROR_INDEX_OUT_OF_RANGE 3 73 | #define DB_ERROR_NO_INDEX 4 74 | #define DB_ERROR_INSERT_INDEX_CLASH 5 75 | 76 | #ifdef __cplusplus 77 | extern "C" { 78 | #endif 79 | 80 | typedef struct txt_db_st 81 | { 82 | int num_fields; 83 | STACK /* char ** */ *data; 84 | LHASH **index; 85 | int (**qual)(char **); 86 | long error; 87 | long arg1; 88 | long arg2; 89 | char **arg_row; 90 | } TXT_DB; 91 | 92 | #ifndef OPENSSL_NO_BIO 93 | TXT_DB *TXT_DB_read(BIO *in, int num); 94 | long TXT_DB_write(BIO *out, TXT_DB *db); 95 | #else 96 | TXT_DB *TXT_DB_read(char *in, int num); 97 | long TXT_DB_write(char *out, TXT_DB *db); 98 | #endif 99 | int TXT_DB_create_index(TXT_DB *db,int field,int (*qual)(char **), 100 | LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); 101 | void TXT_DB_free(TXT_DB *db); 102 | char **TXT_DB_get_by_index(TXT_DB *db, int idx, char **value); 103 | int TXT_DB_insert(TXT_DB *db,char **value); 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /openssl/ui_compat.h: -------------------------------------------------------------------------------- 1 | /* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ 2 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL 3 | * project 2001. 4 | */ 5 | /* ==================================================================== 6 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * 3. All advertising materials mentioning features or use of this 21 | * software must display the following acknowledgment: 22 | * "This product includes software developed by the OpenSSL Project 23 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 24 | * 25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 26 | * endorse or promote products derived from this software without 27 | * prior written permission. For written permission, please contact 28 | * openssl-core@openssl.org. 29 | * 30 | * 5. Products derived from this software may not be called "OpenSSL" 31 | * nor may "OpenSSL" appear in their names without prior written 32 | * permission of the OpenSSL Project. 33 | * 34 | * 6. Redistributions of any form whatsoever must retain the following 35 | * acknowledgment: 36 | * "This product includes software developed by the OpenSSL Project 37 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 38 | * 39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50 | * OF THE POSSIBILITY OF SUCH DAMAGE. 51 | * ==================================================================== 52 | * 53 | * This product includes cryptographic software written by Eric Young 54 | * (eay@cryptsoft.com). This product includes software written by Tim 55 | * Hudson (tjh@cryptsoft.com). 56 | * 57 | */ 58 | 59 | #ifndef HEADER_UI_COMPAT_H 60 | #define HEADER_UI_COMPAT_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /* The following functions were previously part of the DES section, 70 | and are provided here for backward compatibility reasons. */ 71 | 72 | #define des_read_pw_string(b,l,p,v) \ 73 | _ossl_old_des_read_pw_string((b),(l),(p),(v)) 74 | #define des_read_pw(b,bf,s,p,v) \ 75 | _ossl_old_des_read_pw((b),(bf),(s),(p),(v)) 76 | 77 | int _ossl_old_des_read_pw_string(char *buf,int length,const char *prompt,int verify); 78 | int _ossl_old_des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #endif 84 | --------------------------------------------------------------------------------