├── Podfile.lock ├── Pods ├── Headers │ ├── Private │ │ └── SBJson │ │ │ ├── SBJson4.h │ │ │ ├── SBJson4Parser.h │ │ │ ├── SBJson4StreamParser.h │ │ │ ├── SBJson4StreamParserState.h │ │ │ ├── SBJson4StreamTokeniser.h │ │ │ ├── SBJson4StreamWriter.h │ │ │ ├── SBJson4StreamWriterState.h │ │ │ └── SBJson4Writer.h │ └── Public │ │ └── SBJson │ │ ├── SBJson4.h │ │ ├── SBJson4Parser.h │ │ ├── SBJson4StreamParser.h │ │ ├── SBJson4StreamTokeniser.h │ │ ├── SBJson4StreamWriter.h │ │ └── SBJson4Writer.h ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── visitor.xcuserdatad │ │ └── xcschemes │ │ ├── Pods.xcscheme │ │ ├── SBJson.xcscheme │ │ └── xcschememanagement.plist ├── SBJson │ ├── LICENSE │ ├── README.md │ └── src │ │ └── main │ │ └── objc │ │ ├── SBJson4.h │ │ ├── SBJson4Parser.h │ │ ├── SBJson4Parser.m │ │ ├── SBJson4StreamParser.h │ │ ├── SBJson4StreamParser.m │ │ ├── SBJson4StreamParserState.h │ │ ├── SBJson4StreamParserState.m │ │ ├── SBJson4StreamTokeniser.h │ │ ├── SBJson4StreamTokeniser.m │ │ ├── SBJson4StreamWriter.h │ │ ├── SBJson4StreamWriter.m │ │ ├── SBJson4StreamWriterState.h │ │ ├── SBJson4StreamWriterState.m │ │ ├── SBJson4Writer.h │ │ └── SBJson4Writer.m └── Target Support Files │ ├── Pods │ ├── Pods-acknowledgements.markdown │ ├── Pods-acknowledgements.plist │ ├── Pods-dummy.m │ ├── Pods-frameworks.sh │ ├── Pods-resources.sh │ ├── Pods.debug.xcconfig │ └── Pods.release.xcconfig │ └── SBJson │ ├── SBJson-dummy.m │ ├── SBJson-prefix.pch │ └── SBJson.xcconfig ├── README.md ├── Socks.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── Socks.xcscmblueprint │ └── xcuserdata │ │ ├── eversec.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── visitor.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── eversec.xcuserdatad │ └── xcschemes │ │ ├── Socks.xcscheme │ │ └── xcschememanagement.plist │ └── visitor.xcuserdatad │ └── xcschemes │ ├── Socks.xcscheme │ └── xcschememanagement.plist ├── Socks.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── Socks.xcscmblueprint └── xcuserdata │ └── visitor.xcuserdatad │ └── UserInterfaceState.xcuserstate ├── Socks ├── EVProxyProtocol │ ├── EVProxyProtocol.h │ └── EVProxyProtocol.m ├── EVSocksClient │ ├── EVSocksClient.h │ └── EVSocksClient.m ├── EVVerificationCode │ ├── EVVerificationCode.h │ └── EVVerificationCode.m ├── Info.plist ├── Library │ ├── CocoaAsyncSocket │ │ ├── GCDAsyncSocket.h │ │ └── GCDAsyncSocket.m │ ├── Encrypt │ │ ├── encrypt.c │ │ └── encrypt.h │ ├── Openssl │ │ └── openssl.framework │ │ │ ├── Headers │ │ │ ├── aes.h │ │ │ ├── asn1.h │ │ │ ├── asn1_mac.h │ │ │ ├── asn1t.h │ │ │ ├── bio.h │ │ │ ├── blowfish.h │ │ │ ├── bn.h │ │ │ ├── buffer.h │ │ │ ├── camellia.h │ │ │ ├── cast.h │ │ │ ├── cmac.h │ │ │ ├── cms.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 │ │ │ ├── md4.h │ │ │ ├── md5.h │ │ │ ├── mdc2.h │ │ │ ├── modes.h │ │ │ ├── obj_mac.h │ │ │ ├── objects.h │ │ │ ├── ocsp.h │ │ │ ├── opensslconf.h │ │ │ ├── opensslv.h │ │ │ ├── ossl_typ.h │ │ │ ├── pem.h │ │ │ ├── pem2.h │ │ │ ├── pkcs12.h │ │ │ ├── pkcs7.h │ │ │ ├── pqueue.h │ │ │ ├── rand.h │ │ │ ├── rc2.h │ │ │ ├── rc4.h │ │ │ ├── ripemd.h │ │ │ ├── rsa.h │ │ │ ├── safestack.h │ │ │ ├── seed.h │ │ │ ├── sha.h │ │ │ ├── srp.h │ │ │ ├── srtp.h │ │ │ ├── ssl.h │ │ │ ├── ssl2.h │ │ │ ├── ssl23.h │ │ │ ├── ssl3.h │ │ │ ├── stack.h │ │ │ ├── symhacks.h │ │ │ ├── tls1.h │ │ │ ├── ts.h │ │ │ ├── txt_db.h │ │ │ ├── ui.h │ │ │ ├── ui_compat.h │ │ │ ├── whrlpool.h │ │ │ ├── x509.h │ │ │ ├── x509_vfy.h │ │ │ └── x509v3.h │ │ │ └── openssl │ └── Socks5 │ │ └── socks5.h ├── Socks.h └── Utils.h ├── iamge1.png ├── image2.png ├── image3.png ├── podfile └── response.png /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SBJson (4.0.2) 3 | 4 | DEPENDENCIES: 5 | - SBJson (~> 4.0.2) 6 | 7 | SPEC CHECKSUMS: 8 | SBJson: c18691cc18375b14664ff0fec841f8c4faef1934 9 | 10 | COCOAPODS: 0.39.0 11 | -------------------------------------------------------------------------------- /Pods/Headers/Private/SBJson/SBJson4.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SBJson/SBJson4Parser.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4Parser.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SBJson/SBJson4StreamParser.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4StreamParser.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SBJson/SBJson4StreamParserState.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4StreamParserState.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SBJson/SBJson4StreamTokeniser.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4StreamTokeniser.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SBJson/SBJson4StreamWriter.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4StreamWriter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SBJson/SBJson4StreamWriterState.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4StreamWriterState.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SBJson/SBJson4Writer.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4Writer.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SBJson/SBJson4.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SBJson/SBJson4Parser.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4Parser.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SBJson/SBJson4StreamParser.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4StreamParser.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SBJson/SBJson4StreamTokeniser.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4StreamTokeniser.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SBJson/SBJson4StreamWriter.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4StreamWriter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SBJson/SBJson4Writer.h: -------------------------------------------------------------------------------- 1 | ../../../SBJson/src/main/objc/SBJson4Writer.h -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SBJson (4.0.2) 3 | 4 | DEPENDENCIES: 5 | - SBJson (~> 4.0.2) 6 | 7 | SPEC CHECKSUMS: 8 | SBJson: c18691cc18375b14664ff0fec841f8c4faef1934 9 | 10 | COCOAPODS: 0.39.0 11 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/visitor.xcuserdatad/xcschemes/Pods.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/visitor.xcuserdatad/xcschemes/SBJson.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/visitor.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods.xcscheme 8 | 9 | isShown 10 | 11 | 12 | SBJson.xcscheme 13 | 14 | isShown 15 | 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 615B560709770989ECC9EF159FEEBEF5 21 | 22 | primary 23 | 24 | 25 | D70AFE5BB6F994918284A05B06CAE812 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Pods/SBJson/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2007-2014 Stig Brautaset. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, 9 | this list of conditions and the following disclaimer in the documentation 10 | and/or other materials provided with the distribution. 11 | * Neither the name of the author nor the names of its contributors may be used 12 | to endorse or promote products derived from this software without specific 13 | prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 19 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /Pods/SBJson/README.md: -------------------------------------------------------------------------------- 1 | JSON (JavaScript Object Notation) is a light-weight data interchange format 2 | that's easy to read and write for humans and computers alike. This library 3 | implements chunk-based JSON parsing and generation in Objective-C. 4 | 5 | [![Build Status](https://travis-ci.org/stig/json-framework.png?branch=master)](https://travis-ci.org/stig/json-framework) 6 | 7 | Features 8 | ======== 9 | 10 | SBJson's number one feature is chunk-based operation. Feed the parser one or 11 | more chunks of UTF8-encoded data and it will call a block you provide with each 12 | root-level document or array. Or, optionally, for each top-level entry in each 13 | root-level array. See more in the [Version 4 API 14 | docs](http://cocoadocs.org/docsets/SBJson/4.0.0/Classes/SBJson4Parser.html). 15 | 16 | Other features: 17 | 18 | * Configurable recursion limit. For safety SBJson defaults to a max nesting 19 | level of 32 for all input. This can be configured if necessary. 20 | * The writer can optionally sort dictionary keys so output is consistent across writes. 21 | * The writer can optionally create human-readable (indented) output. 22 | 23 | API Documentation 24 | ================= 25 | 26 | Please see the [API Documentation](http://cocoadocs.org/docsets/SBJson) for more details. 27 | 28 | Installation 29 | ============ 30 | 31 | The preferred way to use SBJson is by using 32 | [CocoaPods](http://cocoapods.org/?q=sbjson). In your Podfile use: 33 | 34 | pod 'SBJson', '~> 4.0.1' 35 | 36 | If you depend on a third-party library that requires an earlier version of 37 | SBJson---or want to install both version 3 and 4 in the same app to do a gradual 38 | transition---you can instead use: 39 | 40 | pod 'SBJson4', '~> 4.0.1' 41 | 42 | An alternative that I no longer recommend is to copy all the source files (the 43 | contents of the `src/main/objc` folder) into your own Xcode project. 44 | 45 | Examples 46 | ======== 47 | 48 | * https://github.com/stig/ChunkedDelivery - a toy example showing how one can use `NSURLSessionDataDelegate` to do chunked delivery. 49 | * https://github.com/stig/DisplayPretty - a very brief example using SBJson 4 to reflow JSON on OS X. 50 | 51 | Support 52 | ======= 53 | 54 | * Check [StackOverflow questions tagged with SBJson](http://stackoverflow.com/questions/tagged/sbjson) if you have questions about how to use the library. I eventually read all questions with this tag. 55 | * Use the [issue tracker](http://github.com/stig/json-framework/issues) if you have found a bug. 56 | 57 | License 58 | ======= 59 | 60 | BSD. See LICENSE for details. 61 | -------------------------------------------------------------------------------- /Pods/SBJson/src/main/objc/SBJson4.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009-2011 Stig Brautaset. 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 are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the author nor the names of its contributors may be used 15 | to endorse or promote products derived from this software without specific 16 | prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #import "SBJson4Writer.h" 31 | #import "SBJson4StreamParser.h" 32 | #import "SBJson4Parser.h" 33 | #import "SBJson4StreamWriter.h" 34 | #import "SBJson4StreamTokeniser.h" 35 | 36 | -------------------------------------------------------------------------------- /Pods/SBJson/src/main/objc/SBJson4StreamParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2010-2013, Stig Brautaset. 3 | 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 are 7 | met: 8 | 9 | Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | Neither the name of the the author nor the names of its contributors 17 | may be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 23 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #import 34 | 35 | @class SBJson4StreamParser; 36 | @class SBJson4StreamParserState; 37 | 38 | typedef enum { 39 | SBJson4ParserComplete, 40 | SBJson4ParserStopped, 41 | SBJson4ParserWaitingForData, 42 | SBJson4ParserError, 43 | } SBJson4ParserStatus; 44 | 45 | 46 | /** 47 | Delegate for interacting directly with the low-level parser 48 | 49 | You will most likely find it much more convenient to use the SBJson4Parser instead. 50 | */ 51 | @protocol SBJson4StreamParserDelegate < NSObject > 52 | 53 | /// Called when object start is found 54 | - (void)parserFoundObjectStart; 55 | 56 | /// Called when object key is found 57 | - (void)parserFoundObjectKey:(NSString *)key; 58 | 59 | /// Called when object end is found 60 | - (void)parserFoundObjectEnd; 61 | 62 | /// Called when array start is found 63 | - (void)parserFoundArrayStart; 64 | 65 | /// Called when array end is found 66 | - (void)parserFoundArrayEnd; 67 | 68 | /// Called when a boolean value is found 69 | - (void)parserFoundBoolean:(BOOL)x; 70 | 71 | /// Called when a null value is found 72 | - (void)parserFoundNull; 73 | 74 | /// Called when a number is found 75 | - (void)parserFoundNumber:(NSNumber *)num; 76 | 77 | /// Called when a string is found 78 | - (void)parserFoundString:(NSString *)string; 79 | 80 | /// Called when an error occurs 81 | - (void)parserFoundError:(NSError *)err; 82 | 83 | @optional 84 | 85 | /// Called to determine whether to allow multiple whitespace-separated documents 86 | - (BOOL)parserShouldSupportManyDocuments; 87 | 88 | @end 89 | 90 | /** 91 | Low-level Stream parser 92 | 93 | You most likely want to use the SBJson4Parser instead, but if you 94 | really need low-level access to tokens one-by-one you can use this class. 95 | */ 96 | @interface SBJson4StreamParser : NSObject 97 | 98 | @property (nonatomic, weak) SBJson4StreamParserState *state; // Private 99 | @property (nonatomic, readonly, strong) NSMutableArray *stateStack; // Private 100 | 101 | /** 102 | Delegate to receive messages 103 | 104 | The object set here receives a series of messages as the parser breaks down the JSON stream 105 | into valid tokens. 106 | 107 | Usually this should be an instance of SBJson4Parser, but you can 108 | substitute your own implementation of the SBJson4StreamParserDelegate protocol if you need to. 109 | */ 110 | @property (nonatomic, weak) id delegate; 111 | 112 | /** 113 | Parse some JSON 114 | 115 | The JSON is assumed to be UTF8 encoded. This can be a full JSON document, or a part of one. 116 | 117 | @param data An NSData object containing the next chunk of JSON 118 | 119 | @return 120 | - SBJson4ParserComplete if a full document was found 121 | - SBJson4ParserWaitingForData if a partial document was found and more data is required to complete it 122 | - SBJson4ParserError if an error occurred. 123 | 124 | */ 125 | - (SBJson4ParserStatus)parse:(NSData*)data; 126 | 127 | /** 128 | Call this to cause parsing to stop. 129 | */ 130 | - (void)stop; 131 | 132 | @end 133 | -------------------------------------------------------------------------------- /Pods/SBJson/src/main/objc/SBJson4StreamParserState.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2010, Stig Brautaset. 3 | 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 are 7 | met: 8 | 9 | Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | Neither the name of the the author nor the names of its contributors 17 | may be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 23 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #import 34 | 35 | #import "SBJson4StreamTokeniser.h" 36 | #import "SBJson4StreamParser.h" 37 | 38 | @interface SBJson4StreamParserState : NSObject 39 | + (id)sharedInstance; 40 | 41 | - (BOOL)parser:(SBJson4StreamParser *)parser shouldAcceptToken:(sbjson4_token_t)token; 42 | - (SBJson4ParserStatus)parserShouldReturn:(SBJson4StreamParser *)parser; 43 | - (void)parser:(SBJson4StreamParser *)parser shouldTransitionTo:(sbjson4_token_t)tok; 44 | - (BOOL)needKey; 45 | - (BOOL)isError; 46 | 47 | - (NSString*)name; 48 | 49 | @end 50 | 51 | @interface SBJson4StreamParserStateStart : SBJson4StreamParserState 52 | @end 53 | 54 | @interface SBJson4StreamParserStateComplete : SBJson4StreamParserState 55 | @end 56 | 57 | @interface SBJson4StreamParserStateError : SBJson4StreamParserState 58 | @end 59 | 60 | @interface SBJson4StreamParserStateObjectStart : SBJson4StreamParserState 61 | @end 62 | 63 | @interface SBJson4StreamParserStateObjectGotKey : SBJson4StreamParserState 64 | @end 65 | 66 | @interface SBJson4StreamParserStateObjectSeparator : SBJson4StreamParserState 67 | @end 68 | 69 | @interface SBJson4StreamParserStateObjectGotValue : SBJson4StreamParserState 70 | @end 71 | 72 | @interface SBJson4StreamParserStateObjectNeedKey : SBJson4StreamParserState 73 | @end 74 | 75 | @interface SBJson4StreamParserStateArrayStart : SBJson4StreamParserState 76 | @end 77 | 78 | @interface SBJson4StreamParserStateArrayGotValue : SBJson4StreamParserState 79 | @end 80 | 81 | @interface SBJson4StreamParserStateArrayNeedValue : SBJson4StreamParserState 82 | @end 83 | -------------------------------------------------------------------------------- /Pods/SBJson/src/main/objc/SBJson4StreamTokeniser.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by SuperPappi on 09/01/2013. 3 | // 4 | // To change the template use AppCode | Preferences | File Templates. 5 | // 6 | 7 | #import 8 | 9 | typedef enum { 10 | sbjson4_token_error = -1, 11 | sbjson4_token_eof, 12 | 13 | sbjson4_token_array_open, 14 | sbjson4_token_array_close, 15 | sbjson4_token_value_sep, 16 | 17 | sbjson4_token_object_open, 18 | sbjson4_token_object_close, 19 | sbjson4_token_entry_sep, 20 | 21 | sbjson4_token_bool, 22 | sbjson4_token_null, 23 | 24 | sbjson4_token_integer, 25 | sbjson4_token_real, 26 | 27 | sbjson4_token_string, 28 | sbjson4_token_encoded, 29 | } sbjson4_token_t; 30 | 31 | 32 | @interface SBJson4StreamTokeniser : NSObject 33 | 34 | @property (nonatomic, readonly, copy) NSString *error; 35 | 36 | - (void)appendData:(NSData*)data_; 37 | - (sbjson4_token_t)getToken:(char**)tok length:(NSUInteger*)len; 38 | 39 | @end 40 | 41 | -------------------------------------------------------------------------------- /Pods/SBJson/src/main/objc/SBJson4StreamWriterState.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2010, Stig Brautaset. 3 | 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 are 7 | met: 8 | 9 | Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | Neither the name of the the author nor the names of its contributors 17 | may be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 23 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #import 34 | 35 | @class SBJson4StreamWriter; 36 | 37 | @interface SBJson4StreamWriterState : NSObject 38 | + (id)sharedInstance; 39 | - (BOOL)isInvalidState:(SBJson4StreamWriter *)writer; 40 | - (void)appendSeparator:(SBJson4StreamWriter *)writer; 41 | - (BOOL)expectingKey:(SBJson4StreamWriter *)writer; 42 | - (void)transitionState:(SBJson4StreamWriter *)writer; 43 | - (void)appendWhitespace:(SBJson4StreamWriter *)writer; 44 | @end 45 | 46 | @interface SBJson4StreamWriterStateObjectStart : SBJson4StreamWriterState 47 | @end 48 | 49 | @interface SBJson4StreamWriterStateObjectKey : SBJson4StreamWriterStateObjectStart 50 | @end 51 | 52 | @interface SBJson4StreamWriterStateObjectValue : SBJson4StreamWriterState 53 | @end 54 | 55 | @interface SBJson4StreamWriterStateArrayStart : SBJson4StreamWriterState 56 | @end 57 | 58 | @interface SBJson4StreamWriterStateArrayValue : SBJson4StreamWriterState 59 | @end 60 | 61 | @interface SBJson4StreamWriterStateStart : SBJson4StreamWriterState 62 | @end 63 | 64 | @interface SBJson4StreamWriterStateComplete : SBJson4StreamWriterState 65 | @end 66 | 67 | @interface SBJson4StreamWriterStateError : SBJson4StreamWriterState 68 | @end 69 | 70 | -------------------------------------------------------------------------------- /Pods/SBJson/src/main/objc/SBJson4StreamWriterState.m: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2010, Stig Brautaset. 3 | 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 are 7 | met: 8 | 9 | Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | Neither the name of the the author nor the names of its contributors 17 | may be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 23 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #if !__has_feature(objc_arc) 34 | #error "This source file must be compiled with ARC enabled!" 35 | #endif 36 | 37 | #import "SBJson4StreamWriterState.h" 38 | #import "SBJson4StreamWriter.h" 39 | 40 | #define SINGLETON \ 41 | + (id)sharedInstance { \ 42 | static id state = nil; \ 43 | if (!state) { \ 44 | @synchronized(self) { \ 45 | if (!state) state = [[self alloc] init]; \ 46 | } \ 47 | } \ 48 | return state; \ 49 | } 50 | 51 | 52 | @implementation SBJson4StreamWriterState 53 | + (id)sharedInstance { return nil; } 54 | - (BOOL)isInvalidState:(SBJson4StreamWriter *)writer { return NO; } 55 | - (void)appendSeparator:(SBJson4StreamWriter *)writer {} 56 | - (BOOL)expectingKey:(SBJson4StreamWriter *)writer { return NO; } 57 | - (void)transitionState:(SBJson4StreamWriter *)writer {} 58 | - (void)appendWhitespace:(SBJson4StreamWriter *)writer { 59 | [writer appendBytes:"\n" length:1]; 60 | for (NSUInteger i = 0; i < writer.stateStack.count; i++) 61 | [writer appendBytes:" " length:2]; 62 | } 63 | @end 64 | 65 | @implementation SBJson4StreamWriterStateObjectStart 66 | 67 | SINGLETON 68 | 69 | - (void)transitionState:(SBJson4StreamWriter *)writer { 70 | writer.state = [SBJson4StreamWriterStateObjectValue sharedInstance]; 71 | } 72 | - (BOOL)expectingKey:(SBJson4StreamWriter *)writer { 73 | writer.error = @"JSON object key must be string"; 74 | return YES; 75 | } 76 | @end 77 | 78 | @implementation SBJson4StreamWriterStateObjectKey 79 | 80 | SINGLETON 81 | 82 | - (void)appendSeparator:(SBJson4StreamWriter *)writer { 83 | [writer appendBytes:"," length:1]; 84 | } 85 | @end 86 | 87 | @implementation SBJson4StreamWriterStateObjectValue 88 | 89 | SINGLETON 90 | 91 | - (void)appendSeparator:(SBJson4StreamWriter *)writer { 92 | [writer appendBytes:":" length:1]; 93 | } 94 | - (void)transitionState:(SBJson4StreamWriter *)writer { 95 | writer.state = [SBJson4StreamWriterStateObjectKey sharedInstance]; 96 | } 97 | - (void)appendWhitespace:(SBJson4StreamWriter *)writer { 98 | [writer appendBytes:" " length:1]; 99 | } 100 | @end 101 | 102 | @implementation SBJson4StreamWriterStateArrayStart 103 | 104 | SINGLETON 105 | 106 | - (void)transitionState:(SBJson4StreamWriter *)writer { 107 | writer.state = [SBJson4StreamWriterStateArrayValue sharedInstance]; 108 | } 109 | @end 110 | 111 | @implementation SBJson4StreamWriterStateArrayValue 112 | 113 | SINGLETON 114 | 115 | - (void)appendSeparator:(SBJson4StreamWriter *)writer { 116 | [writer appendBytes:"," length:1]; 117 | } 118 | @end 119 | 120 | @implementation SBJson4StreamWriterStateStart 121 | 122 | SINGLETON 123 | 124 | 125 | - (void)transitionState:(SBJson4StreamWriter *)writer { 126 | writer.state = [SBJson4StreamWriterStateComplete sharedInstance]; 127 | } 128 | - (void)appendSeparator:(SBJson4StreamWriter *)writer { 129 | } 130 | @end 131 | 132 | @implementation SBJson4StreamWriterStateComplete 133 | 134 | SINGLETON 135 | 136 | - (BOOL)isInvalidState:(SBJson4StreamWriter *)writer { 137 | writer.error = @"Stream is closed"; 138 | return YES; 139 | } 140 | @end 141 | 142 | @implementation SBJson4StreamWriterStateError 143 | 144 | SINGLETON 145 | 146 | @end 147 | 148 | -------------------------------------------------------------------------------- /Pods/SBJson/src/main/objc/SBJson4Writer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Stig Brautaset. 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 are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the author nor the names of its contributors may be used 15 | to endorse or promote products derived from this software without specific 16 | prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #import 31 | 32 | /** 33 | The JSON writer class. 34 | 35 | This uses SBJson4StreamWriter internally. 36 | 37 | */ 38 | 39 | @interface SBJson4Writer : NSObject 40 | 41 | /** 42 | The maximum depth. 43 | 44 | Defaults to 32. If the input is nested deeper than this the input will be deemed to be 45 | malicious and the parser returns nil, signalling an error. ("Nested too deep".) You can 46 | turn off this security feature by setting the maxDepth value to 0. 47 | */ 48 | @property(nonatomic) NSUInteger maxDepth; 49 | 50 | /** 51 | Return an error trace, or nil if there was no errors. 52 | 53 | Note that this method returns the trace of the last method that failed. 54 | You need to check the return value of the call you're making to figure out 55 | if the call actually failed, before you know call this method. 56 | */ 57 | @property (nonatomic, readonly, copy) NSString *error; 58 | 59 | /** 60 | Whether we are generating human-readable (multi line) JSON. 61 | 62 | Set whether or not to generate human-readable JSON. The default is NO, which produces 63 | JSON without any whitespace. (Except inside strings.) If set to YES, generates human-readable 64 | JSON with line breaks after each array value and dictionary key/value pair, indented two 65 | spaces per nesting level. 66 | */ 67 | @property(nonatomic) BOOL humanReadable; 68 | 69 | /** 70 | Whether or not to sort the dictionary keys in the output. 71 | 72 | If this is set to YES, the dictionary keys in the JSON output will be in sorted order. 73 | (This is useful if you need to compare two structures, for example.) The default is NO. 74 | */ 75 | @property(nonatomic) BOOL sortKeys; 76 | 77 | /** 78 | An optional comparator to be used if sortKeys is YES. 79 | 80 | If this is nil, sorting will be done via @selector(compare:). 81 | */ 82 | @property (nonatomic, copy) NSComparator sortKeysComparator; 83 | 84 | /** 85 | Generates string with JSON representation for the given object. 86 | 87 | Returns a string containing JSON representation of the passed in value, or nil on error. 88 | If nil is returned and error is not NULL, *error can be interrogated to find the cause of the error. 89 | 90 | @param value any instance that can be represented as JSON text. 91 | */ 92 | - (NSString*)stringWithObject:(id)value; 93 | 94 | /** 95 | Generates JSON representation for the given object. 96 | 97 | Returns an NSData object containing JSON represented as UTF8 text, or nil on error. 98 | 99 | @param value any instance that can be represented as JSON text. 100 | */ 101 | - (NSData*)dataWithObject:(id)value; 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /Pods/SBJson/src/main/objc/SBJson4Writer.m: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Stig Brautaset. 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 are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the author nor the names of its contributors may be used 15 | to endorse or promote products derived from this software without specific 16 | prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #if !__has_feature(objc_arc) 31 | #error "This source file must be compiled with ARC enabled!" 32 | #endif 33 | 34 | #import "SBJson4Writer.h" 35 | #import "SBJson4StreamWriter.h" 36 | 37 | 38 | @interface SBJson4Writer () < SBJson4StreamWriterDelegate > 39 | @property (nonatomic, copy) NSString *error; 40 | @property (nonatomic, strong) NSMutableData *acc; 41 | @end 42 | 43 | @implementation SBJson4Writer 44 | 45 | - (id)init { 46 | self = [super init]; 47 | if (self) { 48 | self.maxDepth = 32u; 49 | } 50 | return self; 51 | } 52 | 53 | 54 | - (NSString*)stringWithObject:(id)value { 55 | NSData *data = [self dataWithObject:value]; 56 | if (data) 57 | return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 58 | return nil; 59 | } 60 | 61 | - (NSData*)dataWithObject:(id)object { 62 | self.error = nil; 63 | 64 | self.acc = [[NSMutableData alloc] initWithCapacity:8096u]; 65 | 66 | SBJson4StreamWriter *streamWriter = [[SBJson4StreamWriter alloc] init]; 67 | streamWriter.sortKeys = self.sortKeys; 68 | streamWriter.maxDepth = self.maxDepth; 69 | streamWriter.sortKeysComparator = self.sortKeysComparator; 70 | streamWriter.humanReadable = self.humanReadable; 71 | streamWriter.delegate = self; 72 | 73 | BOOL ok = NO; 74 | if ([object isKindOfClass:[NSDictionary class]]) 75 | ok = [streamWriter writeObject:object]; 76 | 77 | else if ([object isKindOfClass:[NSArray class]]) 78 | ok = [streamWriter writeArray:object]; 79 | 80 | else if ([object respondsToSelector:@selector(proxyForJson)]) 81 | return [self dataWithObject:[object proxyForJson]]; 82 | else { 83 | self.error = @"Not valid type for JSON"; 84 | return nil; 85 | } 86 | 87 | if (ok) 88 | return self.acc; 89 | 90 | self.error = streamWriter.error; 91 | return nil; 92 | } 93 | 94 | #pragma mark SBJson4StreamWriterDelegate 95 | 96 | - (void)writer:(SBJson4StreamWriter *)writer appendBytes:(const void *)bytes length:(NSUInteger)length { 97 | [self.acc appendBytes:bytes length:length]; 98 | } 99 | 100 | 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SBJson 5 | 6 | Copyright (C) 2007-2015 Stig Brautaset. 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 are met: 10 | 11 | * Redistributions of source code must retain the above copyright notice, this 12 | list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | * Neither the name of the author nor the names of its contributors may be used 17 | to endorse or promote products derived from this software without specific 18 | prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | Generated by CocoaPods - http://cocoapods.org 32 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (C) 2007-2015 Stig Brautaset. 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 are met: 21 | 22 | * Redistributions of source code must retain the above copyright notice, this 23 | list of conditions and the following disclaimer. 24 | * Redistributions in binary form must reproduce the above copyright notice, 25 | this list of conditions and the following disclaimer in the documentation 26 | and/or other materials provided with the distribution. 27 | * Neither the name of the author nor the names of its contributors may be used 28 | to endorse or promote products derived from this software without specific 29 | prior written permission. 30 | 31 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 32 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 33 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 34 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 35 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 37 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 38 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 39 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Title 43 | SBJson 44 | Type 45 | PSGroupSpecifier 46 | 47 | 48 | FooterText 49 | Generated by CocoaPods - http://cocoapods.org 50 | Title 51 | 52 | Type 53 | PSGroupSpecifier 54 | 55 | 56 | StringsTable 57 | Acknowledgements 58 | Title 59 | Acknowledgements 60 | 61 | 62 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SBJson" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SBJson" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SBJson" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SBJson" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SBJson" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SBJson" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/SBJson/SBJson-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SBJson : NSObject 3 | @end 4 | @implementation PodsDummy_SBJson 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SBJson/SBJson-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SBJson/SBJson.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SBJson" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SBJson" 3 | PODS_ROOT = ${SRCROOT} 4 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Drawing 2 | Drawing 3 | Drawing 4 |
5 | 与Socks Server交互截图: 6 |
7 | Drawing 8 | 9 | "somefile" 10 | -------------------------------------------------------------------------------- /Socks.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Socks.xcodeproj/project.xcworkspace/xcshareddata/Socks.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "6854044b-fb13-453c-a592-8ecfda0c42c1++8338", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | "6854044b-fb13-453c-a592-8ecfda0c42c1++8338" : { 5 | 6 | } 7 | }, 8 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 9 | "6854044b-fb13-453c-a592-8ecfda0c42c1++8338" : 0 10 | }, 11 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "4DB026C7-B578-4E1A-A01B-2F3A4BA1BE1F", 12 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 13 | "6854044b-fb13-453c-a592-8ecfda0c42c1++8338" : "" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "Socks", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Socks.xcodeproj", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "http:\/\/192.168.200.125\/svn\/product", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Subversion", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "6854044b-fb13-453c-a592-8ecfda0c42c1++8338" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /Socks.xcodeproj/project.xcworkspace/xcuserdata/eversec.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Visitor-sos/iOS-Socks-SDK/b28a65c9050d86c3d6e0c21fc3fc8b4ed4ec3f3c/Socks.xcodeproj/project.xcworkspace/xcuserdata/eversec.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Socks.xcodeproj/project.xcworkspace/xcuserdata/visitor.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Visitor-sos/iOS-Socks-SDK/b28a65c9050d86c3d6e0c21fc3fc8b4ed4ec3f3c/Socks.xcodeproj/project.xcworkspace/xcuserdata/visitor.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Socks.xcodeproj/xcuserdata/eversec.xcuserdatad/xcschemes/Socks.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Socks.xcodeproj/xcuserdata/eversec.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Socks.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 97B4C3381CBB79C8006EA5F8 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Socks.xcodeproj/xcuserdata/visitor.xcuserdatad/xcschemes/Socks.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Socks.xcodeproj/xcuserdata/visitor.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Socks.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 97B4C3381CBB79C8006EA5F8 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Socks.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Socks.xcworkspace/xcshareddata/Socks.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "6854044b-fb13-453c-a592-8ecfda0c42c1++8338", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | "6854044b-fb13-453c-a592-8ecfda0c42c1++8338" : { 5 | 6 | } 7 | }, 8 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 9 | "6854044b-fb13-453c-a592-8ecfda0c42c1++8338" : 0 10 | }, 11 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "72283C0D-235B-4447-910E-F74534C3E5BC", 12 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 13 | "6854044b-fb13-453c-a592-8ecfda0c42c1++8338" : "" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "Socks", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Socks.xcworkspace", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "http:\/\/192.168.200.125\/svn\/product", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Subversion", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "6854044b-fb13-453c-a592-8ecfda0c42c1++8338" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /Socks.xcworkspace/xcuserdata/visitor.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Visitor-sos/iOS-Socks-SDK/b28a65c9050d86c3d6e0c21fc3fc8b4ed4ec3f3c/Socks.xcworkspace/xcuserdata/visitor.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Socks/EVProxyProtocol/EVProxyProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // EVProxyProtocol.h 3 | // ComplateFlowRateProject 4 | // 5 | // Created by Visitor on 16/3/10. 6 | // Copyright © 2016年 Visitor. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | static NSInteger ssLocalPort; 12 | 13 | @interface EVProxyProtocol : NSURLProtocol 14 | 15 | 16 | /** 17 | * 监听本地端口 18 | * 19 | * @param localPort 本地端口 20 | */ 21 | + (void)setLocalPort:(NSInteger)localPort; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Socks/EVProxyProtocol/EVProxyProtocol.m: -------------------------------------------------------------------------------- 1 | // 2 | // EVProxyProtocol.m 3 | // ComplateFlowRateProject 4 | // 5 | // Created by Visitor on 16/3/10. 6 | // Copyright © 2016年 Visitor. All rights reserved. 7 | // 8 | 9 | #import "EVProxyProtocol.h" 10 | 11 | static NSURLSession *session; 12 | 13 | @interface EVProxyProtocol() 14 | 15 | @property (nonatomic, strong) NSURLSessionDataTask *task; 16 | 17 | @end 18 | 19 | @implementation EVProxyProtocol 20 | 21 | + (BOOL)canInitWithRequest:(NSURLRequest *)request { 22 | return YES; 23 | } 24 | 25 | + (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request { 26 | return request; 27 | } 28 | 29 | + (BOOL)requestIsCacheEquivalent:(NSURLRequest *)a toRequest:(NSURLRequest *)b { 30 | return [super requestIsCacheEquivalent:a toRequest:b]; 31 | } 32 | 33 | + (void)setLocalPort:(NSInteger)localPort { 34 | ssLocalPort = localPort; 35 | } 36 | 37 | - (void)startLoading 38 | { 39 | if (!session) { 40 | NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; 41 | configuration.connectionProxyDictionary = 42 | @{(NSString *)kCFStreamPropertySOCKSProxyHost: @"127.0.0.1", 43 | (NSString *)kCFStreamPropertySOCKSProxyPort: @(ssLocalPort)}; 44 | session = [NSURLSession sessionWithConfiguration:configuration]; 45 | } 46 | 47 | __weak typeof(self)weakSelf = self; 48 | self.task = [session dataTaskWithRequest:self.request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { 49 | //NSLog(@"%@ - %@", self.request.URL, error); 50 | if (error) { 51 | [weakSelf.client URLProtocol:weakSelf didFailWithError:error]; 52 | } else { 53 | [weakSelf.client URLProtocol:weakSelf didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageAllowed]; 54 | [weakSelf.client URLProtocol:weakSelf didLoadData:data]; 55 | [weakSelf.client URLProtocolDidFinishLoading:weakSelf]; 56 | } 57 | }]; 58 | [self.task resume]; 59 | } 60 | 61 | - (void)stopLoading { 62 | [self.task cancel]; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Socks/EVSocksClient/EVSocksClient.h: -------------------------------------------------------------------------------- 1 | // 2 | // EvSocksClient.h 3 | // ComplateFlowRateProject 4 | // 5 | // Created by Visitor on 16/3/10. 6 | // Copyright © 2016年 Visitor. All rights reserved. 7 | // 8 | 9 | #import 10 | @class GCDAsyncSocket; 11 | 12 | /** 13 | socks Server support Authentication Method 14 | */ 15 | enum EVSocksClientConsultMethod { 16 | EVSocksClientConsultMethodNO = 0, // NO AUTHENTICATION REQUIRED 17 | EVSocksClientConsultMethodGSSAPI, // GSSAPI (当前SDK暂不支持) 18 | EVSocksClientConsultMethodUSRPSD, // USERNAME/PASSWORD 19 | }; 20 | typedef enum EVSocksClientConsultMethod EVSocksClientConsultMethod; 21 | 22 | /** 23 | Socks Server Error Message Type 24 | */ 25 | enum EVSocksClientError { 26 | EVSocksClientErrorNoError = 0, // Never used 27 | EVSocksClientErrorNoAuth, // Socks server 无需协商 28 | EVSocksClientErrorNOSupported, // Socks server 协商方式不支持 29 | EVSocksClientErrorValidateFailed, // Socks server 登录验证失败 30 | }; 31 | 32 | #pragma mark - EVSocksClientDelegate 33 | @protocol EVSocksClientDelegate 34 | 35 | @required 36 | /** 37 | * 当监听本地端口出错时调用 38 | * 39 | * @param socket server Socket 40 | * @param error bind error 41 | */ 42 | - (void)evSocket:(GCDAsyncSocket *)socket bindError:(NSError *)error; 43 | 44 | @optional 45 | /** 46 | * 连接Socks Server失败时调用 47 | * 48 | * @param socket remote socket 49 | * @param error 错误提示 50 | */ 51 | - (void)evSocket:(GCDAsyncSocket *)socket didDisconnectWithError:(NSError *)error; 52 | 53 | @end 54 | 55 | 56 | #pragma mark - EVSocksClientConsultDelegate 57 | /** 58 | * 协商Socks Server,获取Connect Server 验证方式 59 | */ 60 | @protocol EVSocksClientConsultDelegate 61 | @optional 62 | /** 63 | * 当Socks Server 协商失败时会调用此函数 64 | * 65 | * @param socks remote socket 66 | * @param error 错误提示 67 | */ 68 | - (void)consultSocket:(GCDAsyncSocket *)socks didFailWithError:(NSError *)error; 69 | 70 | /** 71 | * 当Socks Client 成功接收 Socks Server 返回的data 72 | * 73 | * @param socket remote socket 74 | */ 75 | - (void)consultSocketDidFinishLoad:(GCDAsyncSocket *)socket; 76 | @end 77 | 78 | 79 | #pragma mark - EVSocksClientValidateDelegate 80 | /** 81 | * 倘若Socks Server 需要验证,实现此代理提示验证信息 82 | */ 83 | @protocol EVSocksClientValidateDelegate 84 | @optional 85 | 86 | /** 87 | * 验证Socks Server 失败会调用此方法 88 | * 89 | * @param socket 请求验证的socket Object 90 | * @param error 错误提示 91 | */ 92 | - (void)validateSocket:(GCDAsyncSocket *)socket didFailWithError:(NSError *)error; 93 | 94 | /** 95 | * 验证Socket Server 成功会调用此方法 96 | * 97 | * @param socket 请求验证的socket Object 98 | */ 99 | - (void)validateSocketDidFinishLoad:(GCDAsyncSocket *)socket; 100 | 101 | @end 102 | 103 | @interface EVSocksClient : NSURLProtocol 104 | 105 | @property (nonatomic, assign) EVSocksClientConsultMethod consultMethod; //!< Proxy server 协商方式 106 | @property (nonatomic, readonly) NSString *host; //!< Proxy server address 107 | @property (nonatomic, readonly) NSInteger port; //!< Proxy server port 108 | @property (nonatomic, readonly) NSString *method; //!< Proxy server encrypt method 109 | @property (nonatomic, readonly) NSString *password; //!< Proxy server encrypt password 110 | @property (nonatomic, assign) id evDelegate; //!< socks Delegate 111 | @property (nonatomic, assign) id validateDelegate; //!< Validate Socks Delegate 112 | @property (nonatomic, assign) id consultDelegate; //!< Consult Socks Delegate 113 | 114 | 115 | /** 116 | * 初始化EVSocksClient 117 | * 118 | * @param host proxy server address 119 | * @param port proxy server port 120 | * @param passoword proxy server encrypt password 121 | * @param method proxy server encrypt method 122 | * 123 | * @return EVSocksClient 124 | */ 125 | - (id)initWithHost:(NSString *)host port:(NSInteger)port; 126 | 127 | /** 128 | * 更新Proxy Server信息 129 | * 130 | * @param host proxy server address 131 | * @param port proxy server port 132 | * @param passoword proxy server encrypt password 133 | * @param method proxy server encrypt method 134 | */ 135 | - (void)updateHost:(NSString *)host port:(NSInteger)port password:(NSString *)passoword method:(NSString *)method; 136 | 137 | /** 138 | * 设置Proxy Server 的password 和 加密方法 139 | * 140 | * @param password socks Server 密码 141 | * @param method 加密方法 142 | */ 143 | - (void)setSocksServerPassword:(NSString *)password method:(NSString *)method; 144 | 145 | /** 146 | * 监听本地端口, 一般与Proxy Server address 相同 147 | * 148 | * @param localPort 本地端口 149 | * 150 | * @return return 0 if listen success, otherwise 151 | */ 152 | - (BOOL)startWithLocalPort:(NSInteger)localPort; 153 | 154 | /** 155 | * 倘若需要验证Proxy Server,需调用此函数设置Username/Password 156 | * 157 | * @param username 登录Proxy Server的用户名 158 | * @param password 登录Proxy Server的密码 159 | */ 160 | - (void)setProxyServerUsr:(NSString *)username psd:(NSString *)password; 161 | 162 | 163 | /** 164 | * 停止Proxy Server 165 | */ 166 | - (void)stop; 167 | 168 | /** 169 | * 判断是否已经连接Proxy Server 170 | * 171 | * @return return 0 if has been connected, otherwise 1 172 | */ 173 | - (BOOL)isConnected; 174 | 175 | @end 176 | -------------------------------------------------------------------------------- /Socks/EVVerificationCode/EVVerificationCode.h: -------------------------------------------------------------------------------- 1 | // 2 | // VerificationCode.h 3 | // ExplorerSDKForFlowRate 4 | // 5 | // Created by Visitor on 16/4/11. 6 | // Copyright © 2016年 Visitor. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 获取验证码异常类型 13 | */ 14 | enum EVVerificationError { 15 | EVVerificationErrorNoError = 0, // Never used 16 | EVVerificationErrorServerAddressNil, // 验证码服务器地址为nil 17 | }; 18 | 19 | /** 20 | * 请求验证码,设置请求timeout为5s 21 | */ 22 | @protocol EVVerificationCodeDelegate 23 | 24 | /** 25 | * 服务器响应请求 26 | * 27 | * @param connection connection 28 | * @param response response 29 | */ 30 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response; 31 | 32 | /** 33 | * 接收验证码服务器返回的数据 34 | * 35 | * @param connection connection 36 | * @param data 返回的NSData 37 | */ 38 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data; 39 | 40 | /** 41 | * 数据接收完成 42 | * 43 | * @param connection connection 44 | */ 45 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection; 46 | 47 | /** 48 | * 当网络异常或其他原因导致获取验证码失败时会调用此函数 49 | * 50 | * @param connection 连接验证码Server的Connection 51 | * @param error 错误信息 52 | */ 53 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error; 54 | 55 | @end 56 | 57 | @interface EVVerificationCode : NSObject 58 | @property (nonatomic, strong) NSMutableData *registerData; //!< 服务器返回的注册用户相关数据 59 | @property (nonatomic, strong) NSMutableData *verifyCodeData; //!< 服务器返回的验证码相关信息 60 | @property (nonatomic, strong) NSMutableData *loginData; //!< 服务器返回的Socks Server相关数据 61 | 62 | @property (nonatomic, assign) BOOL isRegister; //!< 判断是否是注册 63 | @property (nonatomic, assign) BOOL isGetVerifyCode; //!< 判断是否获取验证码 64 | @property (nonatomic, assign) BOOL isLogin; //!< 判断是否登录 65 | 66 | @property (nonatomic, assign) id delegate; 67 | 68 | /** 69 | * 初始化服务器地址 70 | * 71 | * @param serverAddress 服务器地址 72 | * 73 | * @return [EVVerificationCode object] 74 | */ 75 | - (id)initWithVerificationCodeServerAddress:(NSString *)serverAddress; 76 | 77 | /** 78 | * 注册账户 79 | */ 80 | - (void)registerAccountWithHttpBody:(NSString *)httpBody; 81 | 82 | 83 | /** 84 | * 输入手机号码,获取验证码 85 | * 说明: 86 | * 1、首次运行App, 需要获取验证码进行验证 87 | * 2、验证通过后,再运行App, 用户无需再次验证, 但是需要开发者手动验证 88 | * 3、步骤2 需要同时满足两个条件(已经验证通过过 && 验证返回的password还未过期) 89 | * 90 | * @param httpBody: 请求登录服务器的json,详细格式请参考接口文旦 91 | */ 92 | - (void)getVerificationCodeWithHttpBody:(NSString *)httpBody; 93 | 94 | /** 95 | * 根据返回的验证码, 再次请求获取 socks Server 的 password 96 | * 97 | * 在获取验证码之后, 98 | * 99 | * @param httpBody http 请求体,详细参考接口文档 100 | */ 101 | - (void)getSocksServerPasswordWithHttpBody:(NSString *)httpBody; 102 | 103 | /** 104 | * 前提:不是首次运行程序,即已经登录成功过 105 | * 说明: 106 | * 在已经验证通过过登录服务器之后的每次再次运行程序,开发者需要调用此函数传参password验证 107 | * 注:此步骤为开发者完成, 无需用户参与 108 | * 109 | * @param password: 这里的password即为首次运行程序时,在调用getSocksServerPasswordWithVerificationCode:函数后,在delegate中获取到的password 110 | * 111 | * 目的: 112 | * 1、检测此用户是否合法 113 | * 2、检测密码是否过期 114 | */ 115 | //- (void)validatePassword:(NSString *)password serverAddress:(NSString *)serverAddr; 116 | 117 | /** 118 | * 获取手机IDFA 119 | */ 120 | - (NSString *)getDevceIDFA; 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /Socks/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Socks/Library/Encrypt/encrypt.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "encrypt.h" 5 | #include "assert.h" 6 | 7 | int encryption_iv_len[] = { 8 | 16, 9 | 16, 10 | 16, 11 | 8, 12 | 16, 13 | 16, 14 | 16, 15 | 8, 16 | 8, 17 | 8, 18 | 8, 19 | 0, 20 | 16 21 | }; 22 | 23 | static const char *encryption_names[] = { 24 | "aes-256-cfb", 25 | "aes-192-cfb", 26 | "aes-128-cfb", 27 | "bf-cfb", 28 | "camellia-128-cfb", 29 | "camellia-192-cfb", 30 | "camellia-256-cfb", 31 | "cast5-cfb", 32 | "des-cfb", 33 | "idea-cfb", 34 | "rc2-cfb", 35 | "rc4", 36 | "rc4-md5", 37 | "seed-cfb" 38 | }; 39 | 40 | 41 | static int _method; 42 | static int _key_len; 43 | static const EVP_CIPHER *_cipher; 44 | static char _key[EVP_MAX_KEY_LENGTH]; 45 | 46 | void init_cipher(struct encryption_ctx *ctx, const unsigned char *iv, int iv_len, int is_cipher); 47 | 48 | int encryption_method_from_string(const char *name) { 49 | // TODO use an O(1) way 50 | for (int i = 0; i < TOTAL_METHODS; i++) { 51 | if (strcasecmp(name, encryption_names[i]) == 0) { 52 | //printf("加密方式为:%s", encryption_names[i]); 53 | return i; 54 | } 55 | } 56 | return 0; 57 | } 58 | 59 | void encrypt_buf(struct encryption_ctx *ctx, char *buf, int *len) { 60 | if (ctx->status == STATUS_EMPTY) { 61 | int iv_len = encryption_iv_len[_method]; 62 | unsigned char iv[EVP_MAX_IV_LENGTH]; 63 | memset(iv, 0, iv_len); 64 | RAND_bytes(iv, iv_len); 65 | init_cipher(ctx, iv, iv_len, 1); 66 | int out_len = *len + EVP_CIPHER_CTX_block_size(ctx->ctx); 67 | unsigned char *cipher_text = malloc(out_len); 68 | EVP_CipherUpdate(ctx->ctx, cipher_text, &out_len, buf, *len); 69 | memcpy(buf, iv, iv_len); 70 | memcpy(buf + iv_len, cipher_text, out_len); 71 | *len = iv_len + out_len; 72 | free(cipher_text); 73 | } else { 74 | int out_len = *len + EVP_CIPHER_CTX_block_size(ctx->ctx); 75 | unsigned char *cipher_text = malloc(out_len); 76 | EVP_CipherUpdate(ctx->ctx, cipher_text, &out_len, buf, *len); 77 | memcpy(buf, cipher_text, out_len); 78 | *len = out_len; 79 | free(cipher_text); 80 | } 81 | } 82 | 83 | void decrypt_buf(struct encryption_ctx *ctx, char *buf, int *len) { 84 | if (ctx->status == STATUS_EMPTY) { 85 | int iv_len = encryption_iv_len[_method]; 86 | init_cipher(ctx, buf, iv_len, 0); 87 | int out_len = *len + EVP_CIPHER_CTX_block_size(ctx->ctx); 88 | out_len -= iv_len; 89 | unsigned char *cipher_text = malloc(out_len); 90 | EVP_CipherUpdate(ctx->ctx, cipher_text, &out_len, buf + iv_len, *len - iv_len); 91 | memcpy(buf, cipher_text, out_len); 92 | *len = out_len; 93 | free(cipher_text); 94 | } else { 95 | int out_len = *len + EVP_CIPHER_CTX_block_size(ctx->ctx); 96 | unsigned char *cipher_text = malloc(out_len); 97 | EVP_CipherUpdate(ctx->ctx, cipher_text, &out_len, buf, *len); 98 | memcpy(buf, cipher_text, out_len); 99 | *len = out_len; 100 | free(cipher_text); 101 | } 102 | } 103 | 104 | int send_encrypt(struct encryption_ctx *ctx, int sock, char *buf, int *len, int flags) { 105 | char mybuf[4096]; 106 | memcpy(mybuf, buf, *len); 107 | encrypt_buf(ctx, mybuf, len); 108 | return send(sock, mybuf, *len, flags); 109 | } 110 | 111 | int recv_decrypt(struct encryption_ctx *ctx, int sock, char *buf, int *len, int flags) { 112 | char mybuf[4096]; 113 | int result = recv(sock, mybuf, *len, flags); 114 | memcpy(buf, mybuf, *len); 115 | decrypt_buf(ctx, buf, len); 116 | return result; 117 | } 118 | 119 | void init_cipher(struct encryption_ctx *ctx, const unsigned char *iv, int iv_len, int is_cipher) { 120 | ctx->status = STATUS_INIT; 121 | EVP_CIPHER_CTX_init(ctx->ctx); 122 | EVP_CipherInit_ex(ctx->ctx, _cipher, NULL, NULL, NULL, is_cipher); 123 | if (!EVP_CIPHER_CTX_set_key_length(ctx->ctx, _key_len)) { 124 | cleanup_encryption(ctx); 125 | // NSLog(@"Invalid key length"); 126 | // assert(0); 127 | // TODO free memory and report error 128 | return; 129 | } 130 | EVP_CIPHER_CTX_set_padding(ctx->ctx, 1); 131 | 132 | EVP_CipherInit_ex(ctx->ctx, NULL, NULL, _key, iv, is_cipher); 133 | } 134 | 135 | void init_encryption(struct encryption_ctx *ctx) { 136 | ctx->status = STATUS_EMPTY; 137 | ctx->ctx = EVP_CIPHER_CTX_new(); 138 | } 139 | 140 | void cleanup_encryption(struct encryption_ctx *ctx) { 141 | if (ctx->status == STATUS_INIT) { 142 | EVP_CIPHER_CTX_cleanup(ctx->ctx); 143 | ctx->status = STATUS_DESTORYED; 144 | } 145 | } 146 | 147 | void config_encryption(const char *password, const char *method) { 148 | SSLeay_add_all_algorithms(); 149 | _method = encryption_method_from_string(method); 150 | const char *name = encryption_names[_method]; 151 | _cipher = EVP_get_cipherbyname(name); 152 | if (_cipher == NULL) { 153 | printf("_cipher nil ... \n"); 154 | //assert(0); 155 | // TODO 156 | } 157 | unsigned char tmp[EVP_MAX_IV_LENGTH]; 158 | _key_len = EVP_BytesToKey(_cipher, EVP_md5(), NULL, password, 159 | strlen(password), 1, _key, tmp); 160 | } 161 | -------------------------------------------------------------------------------- /Socks/Library/Encrypt/encrypt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #import 4 | #import 5 | 6 | struct encryption_ctx { 7 | EVP_CIPHER_CTX* ctx; 8 | uint8_t status; 9 | }; 10 | 11 | #define STATUS_EMPTY 0 12 | #define STATUS_INIT 1 13 | #define STATUS_DESTORYED 2 14 | 15 | #define TOTAL_METHODS 14 16 | 17 | void encrypt_buf(struct encryption_ctx* ctx, char *buf, int *len); 18 | void decrypt_buf(struct encryption_ctx* ctx, char *buf, int *len); 19 | 20 | int send_encrypt(struct encryption_ctx* ctx, int sock, char *buf, int *len, int flags); 21 | int recv_decrypt(struct encryption_ctx* ctx, int sock, char *buf, int *len, int flags); 22 | 23 | void init_encryption(struct encryption_ctx* ctx); 24 | void cleanup_encryption(struct encryption_ctx* ctx); 25 | 26 | void config_encryption(const char *password, const char *method); 27 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | # include 62 | 63 | # define AES_ENCRYPT 1 64 | # define AES_DECRYPT 0 65 | 66 | /* 67 | * Because array size can't be a const in C, the following two are macros. 68 | * Both sizes are in bytes. 69 | */ 70 | # define AES_MAXNR 14 71 | # define AES_BLOCK_SIZE 16 72 | 73 | #ifdef __cplusplus 74 | extern "C" { 75 | #endif 76 | 77 | /* This should be a hidden type, but EVP requires that the size be known */ 78 | struct aes_key_st { 79 | # ifdef AES_LONG 80 | unsigned long rd_key[4 * (AES_MAXNR + 1)]; 81 | # else 82 | unsigned int rd_key[4 * (AES_MAXNR + 1)]; 83 | # endif 84 | int rounds; 85 | }; 86 | typedef struct aes_key_st AES_KEY; 87 | 88 | const char *AES_options(void); 89 | 90 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, 91 | AES_KEY *key); 92 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, 93 | AES_KEY *key); 94 | 95 | int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, 96 | AES_KEY *key); 97 | int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, 98 | AES_KEY *key); 99 | 100 | void AES_encrypt(const unsigned char *in, unsigned char *out, 101 | const AES_KEY *key); 102 | void AES_decrypt(const unsigned char *in, unsigned char *out, 103 | const AES_KEY *key); 104 | 105 | void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, 106 | const AES_KEY *key, const int enc); 107 | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, 108 | size_t length, const AES_KEY *key, 109 | unsigned char *ivec, const int enc); 110 | void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, 111 | size_t length, const AES_KEY *key, 112 | unsigned char *ivec, int *num, const int enc); 113 | void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, 114 | size_t length, const AES_KEY *key, 115 | unsigned char *ivec, int *num, const int enc); 116 | void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, 117 | size_t length, const AES_KEY *key, 118 | unsigned char *ivec, int *num, const int enc); 119 | void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, 120 | size_t length, const AES_KEY *key, 121 | unsigned char *ivec, int *num); 122 | void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, 123 | size_t length, const AES_KEY *key, 124 | unsigned char ivec[AES_BLOCK_SIZE], 125 | unsigned char ecount_buf[AES_BLOCK_SIZE], 126 | unsigned int *num); 127 | /* NB: the IV is _two_ blocks long */ 128 | void AES_ige_encrypt(const unsigned char *in, unsigned char *out, 129 | size_t length, const AES_KEY *key, 130 | unsigned char *ivec, const int enc); 131 | /* NB: the IV is _four_ blocks long */ 132 | void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, 133 | size_t length, const AES_KEY *key, 134 | const AES_KEY *key2, const unsigned char *ivec, 135 | const int enc); 136 | 137 | int AES_wrap_key(AES_KEY *key, const unsigned char *iv, 138 | unsigned char *out, 139 | const unsigned char *in, unsigned int inlen); 140 | int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, 141 | unsigned char *out, 142 | const unsigned char *in, unsigned int inlen); 143 | 144 | 145 | #ifdef __cplusplus 146 | } 147 | #endif 148 | 149 | #endif /* !HEADER_AES_H */ 150 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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(__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 | BF_LONG P[BF_ROUNDS + 2]; 103 | BF_LONG S[4 * 256]; 104 | } BF_KEY; 105 | 106 | # ifdef OPENSSL_FIPS 107 | void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data); 108 | # endif 109 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data); 110 | 111 | void BF_encrypt(BF_LONG *data, const BF_KEY *key); 112 | void BF_decrypt(BF_LONG *data, const BF_KEY *key); 113 | 114 | void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, 115 | const BF_KEY *key, int enc); 116 | void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 117 | const BF_KEY *schedule, unsigned char *ivec, int enc); 118 | void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, 119 | long length, const BF_KEY *schedule, 120 | unsigned char *ivec, int *num, int enc); 121 | void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, 122 | long length, const BF_KEY *schedule, 123 | unsigned char *ivec, int *num); 124 | const char *BF_options(void); 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #endif 131 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | size_t length; /* current number of bytes */ 79 | char *data; 80 | size_t max; /* size of buffer */ 81 | }; 82 | 83 | BUF_MEM *BUF_MEM_new(void); 84 | void BUF_MEM_free(BUF_MEM *a); 85 | int BUF_MEM_grow(BUF_MEM *str, size_t len); 86 | int BUF_MEM_grow_clean(BUF_MEM *str, size_t len); 87 | size_t BUF_strnlen(const char *str, size_t maxlen); 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 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); 92 | 93 | /* safe string functions */ 94 | size_t BUF_strlcpy(char *dst, const char *src, size_t siz); 95 | size_t BUF_strlcat(char *dst, const char *src, size_t siz); 96 | 97 | /* BEGIN ERROR CODES */ 98 | /* 99 | * The following lines are auto generated by the script mkerr.pl. Any changes 100 | * made after this point may be overwritten when the script is next run. 101 | */ 102 | void ERR_load_BUF_strings(void); 103 | 104 | /* Error codes for the BUF functions. */ 105 | 106 | /* Function codes. */ 107 | # define BUF_F_BUF_MEMDUP 103 108 | # define BUF_F_BUF_MEM_GROW 100 109 | # define BUF_F_BUF_MEM_GROW_CLEAN 105 110 | # define BUF_F_BUF_MEM_NEW 101 111 | # define BUF_F_BUF_STRDUP 102 112 | # define BUF_F_BUF_STRNDUP 104 113 | 114 | /* Reason codes. */ 115 | 116 | #ifdef __cplusplus 117 | } 118 | #endif 119 | #endif 120 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/camellia.h: -------------------------------------------------------------------------------- 1 | /* crypto/camellia/camellia.h -*- mode:C; c-file-style: "eay" -*- */ 2 | /* ==================================================================== 3 | * Copyright (c) 2006 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_CAMELLIA_H 53 | # define HEADER_CAMELLIA_H 54 | 55 | # include 56 | 57 | # ifdef OPENSSL_NO_CAMELLIA 58 | # error CAMELLIA is disabled. 59 | # endif 60 | 61 | # include 62 | 63 | # define CAMELLIA_ENCRYPT 1 64 | # define CAMELLIA_DECRYPT 0 65 | 66 | /* 67 | * Because array size can't be a const in C, the following two are macros. 68 | * Both sizes are in bytes. 69 | */ 70 | 71 | #ifdef __cplusplus 72 | extern "C" { 73 | #endif 74 | 75 | /* This should be a hidden type, but EVP requires that the size be known */ 76 | 77 | # define CAMELLIA_BLOCK_SIZE 16 78 | # define CAMELLIA_TABLE_BYTE_LEN 272 79 | # define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4) 80 | 81 | typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match 82 | * with WORD */ 83 | 84 | struct camellia_key_st { 85 | union { 86 | double d; /* ensures 64-bit align */ 87 | KEY_TABLE_TYPE rd_key; 88 | } u; 89 | int grand_rounds; 90 | }; 91 | typedef struct camellia_key_st CAMELLIA_KEY; 92 | 93 | # ifdef OPENSSL_FIPS 94 | int private_Camellia_set_key(const unsigned char *userKey, const int bits, 95 | CAMELLIA_KEY *key); 96 | # endif 97 | int Camellia_set_key(const unsigned char *userKey, const int bits, 98 | CAMELLIA_KEY *key); 99 | 100 | void Camellia_encrypt(const unsigned char *in, unsigned char *out, 101 | const CAMELLIA_KEY *key); 102 | void Camellia_decrypt(const unsigned char *in, unsigned char *out, 103 | const CAMELLIA_KEY *key); 104 | 105 | void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out, 106 | const CAMELLIA_KEY *key, const int enc); 107 | void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out, 108 | size_t length, const CAMELLIA_KEY *key, 109 | unsigned char *ivec, const int enc); 110 | void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out, 111 | size_t length, const CAMELLIA_KEY *key, 112 | unsigned char *ivec, int *num, const int enc); 113 | void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out, 114 | size_t length, const CAMELLIA_KEY *key, 115 | unsigned char *ivec, int *num, const int enc); 116 | void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out, 117 | size_t length, const CAMELLIA_KEY *key, 118 | unsigned char *ivec, int *num, const int enc); 119 | void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out, 120 | size_t length, const CAMELLIA_KEY *key, 121 | unsigned char *ivec, int *num); 122 | void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, 123 | size_t length, const CAMELLIA_KEY *key, 124 | unsigned char ivec[CAMELLIA_BLOCK_SIZE], 125 | unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE], 126 | unsigned int *num); 127 | 128 | #ifdef __cplusplus 129 | } 130 | #endif 131 | 132 | #endif /* !HEADER_Camellia_H */ 133 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 int 76 | 77 | # define CAST_BLOCK 8 78 | # define CAST_KEY_LENGTH 16 79 | 80 | typedef struct cast_key_st { 81 | CAST_LONG data[32]; 82 | int short_key; /* Use reduced rounds for short key */ 83 | } CAST_KEY; 84 | 85 | # ifdef OPENSSL_FIPS 86 | void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); 87 | # endif 88 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); 89 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, 90 | const CAST_KEY *key, int enc); 91 | void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key); 92 | void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key); 93 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, 94 | long length, const CAST_KEY *ks, unsigned char *iv, 95 | int enc); 96 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, 97 | long length, const CAST_KEY *schedule, 98 | unsigned char *ivec, int *num, int enc); 99 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, 100 | long length, const CAST_KEY *schedule, 101 | unsigned char *ivec, int *num); 102 | 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | 107 | #endif 108 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/cmac.h: -------------------------------------------------------------------------------- 1 | /* crypto/cmac/cmac.h */ 2 | /* 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 4 | * project. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 2010 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 | * licensing@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 | 55 | #ifndef HEADER_CMAC_H 56 | # define HEADER_CMAC_H 57 | 58 | #ifdef __cplusplus 59 | extern "C" { 60 | #endif 61 | 62 | # include 63 | 64 | /* Opaque */ 65 | typedef struct CMAC_CTX_st CMAC_CTX; 66 | 67 | CMAC_CTX *CMAC_CTX_new(void); 68 | void CMAC_CTX_cleanup(CMAC_CTX *ctx); 69 | void CMAC_CTX_free(CMAC_CTX *ctx); 70 | EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); 71 | int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); 72 | 73 | int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, 74 | const EVP_CIPHER *cipher, ENGINE *impl); 75 | int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); 76 | int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); 77 | int CMAC_resume(CMAC_CTX *ctx); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #endif 83 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | int type; /* NID for compression library */ 15 | const char *name; /* A text string to identify the library */ 16 | int (*init) (COMP_CTX *ctx); 17 | void (*finish) (COMP_CTX *ctx); 18 | int (*compress) (COMP_CTX *ctx, 19 | unsigned char *out, unsigned int olen, 20 | unsigned char *in, unsigned int ilen); 21 | int (*expand) (COMP_CTX *ctx, 22 | unsigned char *out, unsigned int olen, 23 | unsigned char *in, unsigned int ilen); 24 | /* 25 | * The following two do NOTHING, but are kept for backward compatibility 26 | */ 27 | long (*ctrl) (void); 28 | long (*callback_ctrl) (void); 29 | } COMP_METHOD; 30 | 31 | struct comp_ctx_st { 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 | CRYPTO_EX_DATA ex_data; 38 | }; 39 | 40 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 41 | void COMP_CTX_free(COMP_CTX *ctx); 42 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 43 | unsigned char *in, int ilen); 44 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 45 | unsigned char *in, int ilen); 46 | COMP_METHOD *COMP_rle(void); 47 | COMP_METHOD *COMP_zlib(void); 48 | void COMP_zlib_cleanup(void); 49 | 50 | # ifdef HEADER_BIO_H 51 | # ifdef ZLIB 52 | BIO_METHOD *BIO_f_zlib(void); 53 | # endif 54 | # endif 55 | 56 | /* BEGIN ERROR CODES */ 57 | /* 58 | * The following lines are auto generated by the script mkerr.pl. Any changes 59 | * made after this point may be overwritten when the script is next run. 60 | */ 61 | void ERR_load_COMP_strings(void); 62 | 63 | /* Error codes for the COMP functions. */ 64 | 65 | /* Function codes. */ 66 | # define COMP_F_BIO_ZLIB_FLUSH 99 67 | # define COMP_F_BIO_ZLIB_NEW 100 68 | # define COMP_F_BIO_ZLIB_READ 101 69 | # define COMP_F_BIO_ZLIB_WRITE 102 70 | 71 | /* Reason codes. */ 72 | # define COMP_R_ZLIB_DEFLATE_ERROR 99 73 | # define COMP_R_ZLIB_INFLATE_ERROR 100 74 | # define COMP_R_ZLIB_NOT_SUPPORTED 101 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | #endif 80 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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, 81 | const char *name); 82 | 83 | int _CONF_new_data(CONF *conf); 84 | void _CONF_free_data(CONF *conf); 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | #endif 90 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | # define HEADER_EBCDIC_H 5 | 6 | # include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /* Avoid name clashes with other applications */ 13 | # define os_toascii _openssl_os_toascii 14 | # define os_toebcdic _openssl_os_toebcdic 15 | # define ebcdic2ascii _openssl_ebcdic2ascii 16 | # define ascii2ebcdic _openssl_ascii2ebcdic 17 | 18 | extern const unsigned char os_toascii[256]; 19 | extern const unsigned char os_toebcdic[256]; 20 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 21 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | # define EC_FLAG_COFACTOR_ECDH 0x1000 89 | 90 | const ECDH_METHOD *ECDH_OpenSSL(void); 91 | 92 | void ECDH_set_default_method(const ECDH_METHOD *); 93 | const ECDH_METHOD *ECDH_get_default_method(void); 94 | int ECDH_set_method(EC_KEY *, const ECDH_METHOD *); 95 | 96 | int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, 97 | EC_KEY *ecdh, void *(*KDF) (const void *in, size_t inlen, 98 | void *out, size_t *outlen)); 99 | 100 | int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new 101 | *new_func, CRYPTO_EX_dup *dup_func, 102 | CRYPTO_EX_free *free_func); 103 | int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg); 104 | void *ECDH_get_ex_data(EC_KEY *d, int idx); 105 | 106 | int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, 107 | const unsigned char *Z, size_t Zlen, 108 | const unsigned char *sinfo, size_t sinfolen, 109 | const EVP_MD *md); 110 | 111 | /* BEGIN ERROR CODES */ 112 | /* 113 | * The following lines are auto generated by the script mkerr.pl. Any changes 114 | * made after this point may be overwritten when the script is next run. 115 | */ 116 | void ERR_load_ECDH_strings(void); 117 | 118 | /* Error codes for the ECDH functions. */ 119 | 120 | /* Function codes. */ 121 | # define ECDH_F_ECDH_CHECK 102 122 | # define ECDH_F_ECDH_COMPUTE_KEY 100 123 | # define ECDH_F_ECDH_DATA_NEW_METHOD 101 124 | 125 | /* Reason codes. */ 126 | # define ECDH_R_KDF_FAILED 102 127 | # define ECDH_R_NON_FIPS_METHOD 103 128 | # define ECDH_R_NO_PRIVATE_VALUE 100 129 | # define ECDH_R_POINT_ARITHMETIC_FAILURE 101 130 | 131 | #ifdef __cplusplus 132 | } 133 | #endif 134 | #endif 135 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | const EVP_MD *md; 77 | EVP_MD_CTX md_ctx; 78 | EVP_MD_CTX i_ctx; 79 | EVP_MD_CTX o_ctx; 80 | unsigned int key_length; 81 | unsigned char key[HMAC_MAX_MD_CBLOCK]; 82 | } HMAC_CTX; 83 | 84 | # define HMAC_size(e) (EVP_MD_size((e)->md)) 85 | 86 | void HMAC_CTX_init(HMAC_CTX *ctx); 87 | void HMAC_CTX_cleanup(HMAC_CTX *ctx); 88 | 89 | /* deprecated */ 90 | # define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) 91 | 92 | /* deprecated */ 93 | int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md); 94 | int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, 95 | const EVP_MD *md, ENGINE *impl); 96 | int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); 97 | int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); 98 | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, 99 | const unsigned char *d, size_t n, unsigned char *md, 100 | unsigned int *md_len); 101 | int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); 102 | 103 | void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | IDEA_INT data[9][6]; 80 | } IDEA_KEY_SCHEDULE; 81 | 82 | const char *idea_options(void); 83 | void idea_ecb_encrypt(const unsigned char *in, unsigned char *out, 84 | IDEA_KEY_SCHEDULE *ks); 85 | # ifdef OPENSSL_FIPS 86 | void private_idea_set_encrypt_key(const unsigned char *key, 87 | IDEA_KEY_SCHEDULE *ks); 88 | # endif 89 | void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); 90 | void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); 91 | void idea_cbc_encrypt(const unsigned char *in, unsigned char *out, 92 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 93 | int enc); 94 | void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out, 95 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 96 | int *num, int enc); 97 | void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out, 98 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 99 | int *num); 100 | void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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(__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 | MD4_LONG A, B, C, D; 102 | MD4_LONG Nl, Nh; 103 | MD4_LONG data[MD4_LBLOCK]; 104 | unsigned int num; 105 | } MD4_CTX; 106 | 107 | # ifdef OPENSSL_FIPS 108 | int private_MD4_Init(MD4_CTX *c); 109 | # endif 110 | int MD4_Init(MD4_CTX *c); 111 | int MD4_Update(MD4_CTX *c, const void *data, size_t len); 112 | int MD4_Final(unsigned char *md, MD4_CTX *c); 113 | unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); 114 | void MD4_Transform(MD4_CTX *c, const unsigned char *b); 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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(__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 | MD5_LONG A, B, C, D; 102 | MD5_LONG Nl, Nh; 103 | MD5_LONG data[MD5_LBLOCK]; 104 | unsigned int num; 105 | } MD5_CTX; 106 | 107 | # ifdef OPENSSL_FIPS 108 | int private_MD5_Init(MD5_CTX *c); 109 | # endif 110 | int MD5_Init(MD5_CTX *c); 111 | int MD5_Update(MD5_CTX *c, const void *data, size_t len); 112 | int MD5_Final(unsigned char *md, MD5_CTX *c); 113 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); 114 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/mdc2.h: -------------------------------------------------------------------------------- 1 | /* crypto/mdc2/mdc2.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_MDC2_H 60 | # define HEADER_MDC2_H 61 | 62 | # include 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | # ifdef OPENSSL_NO_MDC2 69 | # error MDC2 is disabled. 70 | # endif 71 | 72 | # define MDC2_BLOCK 8 73 | # define MDC2_DIGEST_LENGTH 16 74 | 75 | typedef struct mdc2_ctx_st { 76 | unsigned int num; 77 | unsigned char data[MDC2_BLOCK]; 78 | DES_cblock h, hh; 79 | int pad_type; /* either 1 or 2, default 1 */ 80 | } MDC2_CTX; 81 | 82 | # ifdef OPENSSL_FIPS 83 | int private_MDC2_Init(MDC2_CTX *c); 84 | # endif 85 | int MDC2_Init(MDC2_CTX *c); 86 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); 87 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); 88 | unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/opensslv.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_OPENSSLV_H 2 | # define HEADER_OPENSSLV_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /*- 9 | * Numeric release version identifier: 10 | * MNNFFPPS: major minor fix patch status 11 | * The status nibble has one of the values 0 for development, 1 to e for betas 12 | * 1 to 14, and f for release. The patch level is exactly that. 13 | * For example: 14 | * 0.9.3-dev 0x00903000 15 | * 0.9.3-beta1 0x00903001 16 | * 0.9.3-beta2-dev 0x00903002 17 | * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) 18 | * 0.9.3 0x0090300f 19 | * 0.9.3a 0x0090301f 20 | * 0.9.4 0x0090400f 21 | * 1.2.3z 0x102031af 22 | * 23 | * For continuity reasons (because 0.9.5 is already out, and is coded 24 | * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level 25 | * part is slightly different, by setting the highest bit. This means 26 | * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start 27 | * with 0x0090600S... 28 | * 29 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) 30 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for 31 | * major minor fix final patch/beta) 32 | */ 33 | # define OPENSSL_VERSION_NUMBER 0x1000201fL 34 | # ifdef OPENSSL_FIPS 35 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2a-fips 19 Mar 2015" 36 | # else 37 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2a 19 Mar 2015" 38 | # endif 39 | # define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT 40 | 41 | /*- 42 | * The macros below are to be used for shared library (.so, .dll, ...) 43 | * versioning. That kind of versioning works a bit differently between 44 | * operating systems. The most usual scheme is to set a major and a minor 45 | * number, and have the runtime loader check that the major number is equal 46 | * to what it was at application link time, while the minor number has to 47 | * be greater or equal to what it was at application link time. With this 48 | * scheme, the version number is usually part of the file name, like this: 49 | * 50 | * libcrypto.so.0.9 51 | * 52 | * Some unixen also make a softlink with the major verson number only: 53 | * 54 | * libcrypto.so.0 55 | * 56 | * On Tru64 and IRIX 6.x it works a little bit differently. There, the 57 | * shared library version is stored in the file, and is actually a series 58 | * of versions, separated by colons. The rightmost version present in the 59 | * library when linking an application is stored in the application to be 60 | * matched at run time. When the application is run, a check is done to 61 | * see if the library version stored in the application matches any of the 62 | * versions in the version string of the library itself. 63 | * This version string can be constructed in any way, depending on what 64 | * kind of matching is desired. However, to implement the same scheme as 65 | * the one used in the other unixen, all compatible versions, from lowest 66 | * to highest, should be part of the string. Consecutive builds would 67 | * give the following versions strings: 68 | * 69 | * 3.0 70 | * 3.0:3.1 71 | * 3.0:3.1:3.2 72 | * 4.0 73 | * 4.0:4.1 74 | * 75 | * Notice how version 4 is completely incompatible with version, and 76 | * therefore give the breach you can see. 77 | * 78 | * There may be other schemes as well that I haven't yet discovered. 79 | * 80 | * So, here's the way it works here: first of all, the library version 81 | * number doesn't need at all to match the overall OpenSSL version. 82 | * However, it's nice and more understandable if it actually does. 83 | * The current library version is stored in the macro SHLIB_VERSION_NUMBER, 84 | * which is just a piece of text in the format "M.m.e" (Major, minor, edit). 85 | * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, 86 | * we need to keep a history of version numbers, which is done in the 87 | * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and 88 | * should only keep the versions that are binary compatible with the current. 89 | */ 90 | # define SHLIB_VERSION_HISTORY "" 91 | # define SHLIB_VERSION_NUMBER "1.0.0" 92 | 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | #endif /* HEADER_OPENSSLV_H */ 98 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | #ifdef __cplusplus 68 | extern "C" { 69 | #endif 70 | typedef struct _pqueue *pqueue; 71 | 72 | typedef struct _pitem { 73 | unsigned char priority[8]; /* 64-bit value in big-endian encoding */ 74 | void *data; 75 | struct _pitem *next; 76 | } pitem; 77 | 78 | typedef struct _pitem *piterator; 79 | 80 | pitem *pitem_new(unsigned char *prio64be, 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, unsigned char *prio64be); 90 | pitem *pqueue_iterator(pqueue pq); 91 | pitem *pqueue_next(piterator *iter); 92 | 93 | void pqueue_print(pqueue pq); 94 | int pqueue_size(pqueue pq); 95 | 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | #endif /* ! HEADER_PQUEUE_H */ 100 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | void (*seed) (const void *buf, int num); 83 | int (*bytes) (unsigned char *buf, int num); 84 | void (*cleanup) (void); 85 | void (*add) (const void *buf, int num, double entropy); 86 | int (*pseudorand) (unsigned char *buf, int num); 87 | int (*status) (void); 88 | }; 89 | 90 | # ifdef BN_DEBUG 91 | extern int rand_predictable; 92 | # endif 93 | 94 | int RAND_set_rand_method(const RAND_METHOD *meth); 95 | const RAND_METHOD *RAND_get_rand_method(void); 96 | # ifndef OPENSSL_NO_ENGINE 97 | int RAND_set_rand_engine(ENGINE *engine); 98 | # endif 99 | RAND_METHOD *RAND_SSLeay(void); 100 | void RAND_cleanup(void); 101 | int RAND_bytes(unsigned char *buf, int num); 102 | int RAND_pseudo_bytes(unsigned char *buf, int num); 103 | void RAND_seed(const void *buf, int num); 104 | void RAND_add(const void *buf, int num, double entropy); 105 | int RAND_load_file(const char *file, long max_bytes); 106 | int RAND_write_file(const char *file); 107 | const char *RAND_file_name(char *file, size_t num); 108 | int RAND_status(void); 109 | int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); 110 | int RAND_egd(const char *path); 111 | int RAND_egd_bytes(const char *path, int bytes); 112 | int RAND_poll(void); 113 | 114 | # if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) 115 | 116 | void RAND_screen(void); 117 | int RAND_event(UINT, WPARAM, LPARAM); 118 | 119 | # endif 120 | 121 | # ifdef OPENSSL_FIPS 122 | void RAND_set_fips_drbg_type(int type, int flags); 123 | int RAND_init_fips(void); 124 | # endif 125 | 126 | /* BEGIN ERROR CODES */ 127 | /* 128 | * The following lines are auto generated by the script mkerr.pl. Any changes 129 | * made after this point may be overwritten when the script is next run. 130 | */ 131 | void ERR_load_RAND_strings(void); 132 | 133 | /* Error codes for the RAND functions. */ 134 | 135 | /* Function codes. */ 136 | # define RAND_F_RAND_GET_RAND_METHOD 101 137 | # define RAND_F_RAND_INIT_FIPS 102 138 | # define RAND_F_SSLEAY_RAND_BYTES 100 139 | 140 | /* Reason codes. */ 141 | # define RAND_R_DUAL_EC_DRBG_DISABLED 104 142 | # define RAND_R_ERROR_INITIALISING_DRBG 102 143 | # define RAND_R_ERROR_INSTANTIATING_DRBG 103 144 | # define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101 145 | # define RAND_R_PRNG_NOT_SEEDED 100 146 | 147 | #ifdef __cplusplus 148 | } 149 | #endif 150 | #endif 151 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | RC2_INT data[64]; 79 | } RC2_KEY; 80 | 81 | # ifdef OPENSSL_FIPS 82 | void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, 83 | int bits); 84 | # endif 85 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits); 86 | void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out, 87 | RC2_KEY *key, int enc); 88 | void RC2_encrypt(unsigned long *data, RC2_KEY *key); 89 | void RC2_decrypt(unsigned long *data, RC2_KEY *key); 90 | void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 91 | RC2_KEY *ks, unsigned char *iv, int enc); 92 | void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, 93 | long length, RC2_KEY *schedule, unsigned char *ivec, 94 | int *num, int enc); 95 | void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, 96 | long length, RC2_KEY *schedule, unsigned char *ivec, 97 | int *num); 98 | 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | # include 68 | 69 | #ifdef __cplusplus 70 | extern "C" { 71 | #endif 72 | 73 | typedef struct rc4_key_st { 74 | RC4_INT x, y; 75 | RC4_INT data[256]; 76 | } RC4_KEY; 77 | 78 | const char *RC4_options(void); 79 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 80 | void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 81 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, 82 | unsigned char *outdata); 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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(__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 | RIPEMD160_LONG A, B, C, D, E; 88 | RIPEMD160_LONG Nl, Nh; 89 | RIPEMD160_LONG data[RIPEMD160_LBLOCK]; 90 | unsigned int num; 91 | } RIPEMD160_CTX; 92 | 93 | # ifdef OPENSSL_FIPS 94 | int private_RIPEMD160_Init(RIPEMD160_CTX *c); 95 | # endif 96 | int RIPEMD160_Init(RIPEMD160_CTX *c); 97 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); 98 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); 99 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md); 100 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/seed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 KISA(Korea Information Security Agency). 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 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Neither the name of author nor the names of its contributors may 10 | * be used to endorse or promote products derived from this software 11 | * without specific prior written permission. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 17 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 | * SUCH DAMAGE. 24 | * 25 | */ 26 | /* ==================================================================== 27 | * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. 28 | * 29 | * Redistribution and use in source and binary forms, with or without 30 | * modification, are permitted provided that the following conditions 31 | * are met: 32 | * 33 | * 1. Redistributions of source code must retain the above copyright 34 | * notice, this list of conditions and the following disclaimer. 35 | * 36 | * 2. Redistributions in binary form must reproduce the above copyright 37 | * notice, this list of conditions and the following disclaimer in 38 | * the documentation and/or other materials provided with the 39 | * distribution. 40 | * 41 | * 3. All advertising materials mentioning features or use of this 42 | * software must display the following acknowledgment: 43 | * "This product includes software developed by the OpenSSL Project 44 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 45 | * 46 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 47 | * endorse or promote products derived from this software without 48 | * prior written permission. For written permission, please contact 49 | * openssl-core@openssl.org. 50 | * 51 | * 5. Products derived from this software may not be called "OpenSSL" 52 | * nor may "OpenSSL" appear in their names without prior written 53 | * permission of the OpenSSL Project. 54 | * 55 | * 6. Redistributions of any form whatsoever must retain the following 56 | * acknowledgment: 57 | * "This product includes software developed by the OpenSSL Project 58 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 59 | * 60 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 61 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 62 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 63 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 64 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 65 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 66 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 67 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 68 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 69 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 70 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 71 | * OF THE POSSIBILITY OF SUCH DAMAGE. 72 | * ==================================================================== 73 | * 74 | * This product includes cryptographic software written by Eric Young 75 | * (eay@cryptsoft.com). This product includes software written by Tim 76 | * Hudson (tjh@cryptsoft.com). 77 | * 78 | */ 79 | 80 | #ifndef HEADER_SEED_H 81 | # define HEADER_SEED_H 82 | 83 | # include 84 | # include 85 | # include 86 | 87 | # ifdef OPENSSL_NO_SEED 88 | # error SEED is disabled. 89 | # endif 90 | 91 | /* look whether we need 'long' to get 32 bits */ 92 | # ifdef AES_LONG 93 | # ifndef SEED_LONG 94 | # define SEED_LONG 1 95 | # endif 96 | # endif 97 | 98 | # if !defined(NO_SYS_TYPES_H) 99 | # include 100 | # endif 101 | 102 | # define SEED_BLOCK_SIZE 16 103 | # define SEED_KEY_LENGTH 16 104 | 105 | 106 | #ifdef __cplusplus 107 | extern "C" { 108 | #endif 109 | 110 | typedef struct seed_key_st { 111 | # ifdef SEED_LONG 112 | unsigned long data[32]; 113 | # else 114 | unsigned int data[32]; 115 | # endif 116 | } SEED_KEY_SCHEDULE; 117 | 118 | # ifdef OPENSSL_FIPS 119 | void private_SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], 120 | SEED_KEY_SCHEDULE *ks); 121 | # endif 122 | void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], 123 | SEED_KEY_SCHEDULE *ks); 124 | 125 | void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE], 126 | unsigned char d[SEED_BLOCK_SIZE], 127 | const SEED_KEY_SCHEDULE *ks); 128 | void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE], 129 | unsigned char d[SEED_BLOCK_SIZE], 130 | const SEED_KEY_SCHEDULE *ks); 131 | 132 | void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out, 133 | const SEED_KEY_SCHEDULE *ks, int enc); 134 | void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len, 135 | const SEED_KEY_SCHEDULE *ks, 136 | unsigned char ivec[SEED_BLOCK_SIZE], int enc); 137 | void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out, 138 | size_t len, const SEED_KEY_SCHEDULE *ks, 139 | unsigned char ivec[SEED_BLOCK_SIZE], int *num, 140 | int enc); 141 | void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out, 142 | size_t len, const SEED_KEY_SCHEDULE *ks, 143 | unsigned char ivec[SEED_BLOCK_SIZE], int *num); 144 | 145 | #ifdef __cplusplus 146 | } 147 | #endif 148 | 149 | #endif /* HEADER_SEED_H */ 150 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/srp.h: -------------------------------------------------------------------------------- 1 | /* crypto/srp/srp.h */ 2 | /* 3 | * Written by Christophe Renou (christophe.renou@edelweb.fr) with the 4 | * precious help of Peter Sylvester (peter.sylvester@edelweb.fr) for the 5 | * EdelKey project and contributed to the OpenSSL project 2004. 6 | */ 7 | /* ==================================================================== 8 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * 2. Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in 19 | * the documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgment: 24 | * "This product includes software developed by the OpenSSL Project 25 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 26 | * 27 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 28 | * endorse or promote products derived from this software without 29 | * prior written permission. For written permission, please contact 30 | * licensing@OpenSSL.org. 31 | * 32 | * 5. Products derived from this software may not be called "OpenSSL" 33 | * nor may "OpenSSL" appear in their names without prior written 34 | * permission of the OpenSSL Project. 35 | * 36 | * 6. Redistributions of any form whatsoever must retain the following 37 | * acknowledgment: 38 | * "This product includes software developed by the OpenSSL Project 39 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 42 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 44 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 45 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 46 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 47 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 48 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 49 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 50 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 51 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 52 | * OF THE POSSIBILITY OF SUCH DAMAGE. 53 | * ==================================================================== 54 | * 55 | * This product includes cryptographic software written by Eric Young 56 | * (eay@cryptsoft.com). This product includes software written by Tim 57 | * Hudson (tjh@cryptsoft.com). 58 | * 59 | */ 60 | #ifndef __SRP_H__ 61 | # define __SRP_H__ 62 | 63 | # ifndef OPENSSL_NO_SRP 64 | 65 | # include 66 | # include 67 | 68 | #ifdef __cplusplus 69 | extern "C" { 70 | #endif 71 | 72 | # include 73 | # include 74 | # include 75 | 76 | typedef struct SRP_gN_cache_st { 77 | char *b64_bn; 78 | BIGNUM *bn; 79 | } SRP_gN_cache; 80 | 81 | 82 | DECLARE_STACK_OF(SRP_gN_cache) 83 | 84 | typedef struct SRP_user_pwd_st { 85 | char *id; 86 | BIGNUM *s; 87 | BIGNUM *v; 88 | const BIGNUM *g; 89 | const BIGNUM *N; 90 | char *info; 91 | } SRP_user_pwd; 92 | 93 | DECLARE_STACK_OF(SRP_user_pwd) 94 | 95 | typedef struct SRP_VBASE_st { 96 | STACK_OF(SRP_user_pwd) *users_pwd; 97 | STACK_OF(SRP_gN_cache) *gN_cache; 98 | /* to simulate a user */ 99 | char *seed_key; 100 | BIGNUM *default_g; 101 | BIGNUM *default_N; 102 | } SRP_VBASE; 103 | 104 | /* 105 | * Structure interne pour retenir les couples N et g 106 | */ 107 | typedef struct SRP_gN_st { 108 | char *id; 109 | BIGNUM *g; 110 | BIGNUM *N; 111 | } SRP_gN; 112 | 113 | DECLARE_STACK_OF(SRP_gN) 114 | 115 | SRP_VBASE *SRP_VBASE_new(char *seed_key); 116 | int SRP_VBASE_free(SRP_VBASE *vb); 117 | int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file); 118 | SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username); 119 | char *SRP_create_verifier(const char *user, const char *pass, char **salt, 120 | char **verifier, const char *N, const char *g); 121 | int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, 122 | BIGNUM **verifier, BIGNUM *N, BIGNUM *g); 123 | 124 | # define SRP_NO_ERROR 0 125 | # define SRP_ERR_VBASE_INCOMPLETE_FILE 1 126 | # define SRP_ERR_VBASE_BN_LIB 2 127 | # define SRP_ERR_OPEN_FILE 3 128 | # define SRP_ERR_MEMORY 4 129 | 130 | # define DB_srptype 0 131 | # define DB_srpverifier 1 132 | # define DB_srpsalt 2 133 | # define DB_srpid 3 134 | # define DB_srpgN 4 135 | # define DB_srpinfo 5 136 | # undef DB_NUMBER 137 | # define DB_NUMBER 6 138 | 139 | # define DB_SRP_INDEX 'I' 140 | # define DB_SRP_VALID 'V' 141 | # define DB_SRP_REVOKED 'R' 142 | # define DB_SRP_MODIF 'v' 143 | 144 | /* see srp.c */ 145 | char *SRP_check_known_gN_param(BIGNUM *g, BIGNUM *N); 146 | SRP_gN *SRP_get_default_gN(const char *id); 147 | 148 | /* server side .... */ 149 | BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b, 150 | BIGNUM *N); 151 | BIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v); 152 | int SRP_Verify_A_mod_N(BIGNUM *A, BIGNUM *N); 153 | BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N); 154 | 155 | /* client side .... */ 156 | BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass); 157 | BIGNUM *SRP_Calc_A(BIGNUM *a, BIGNUM *N, BIGNUM *g); 158 | BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x, 159 | BIGNUM *a, BIGNUM *u); 160 | int SRP_Verify_B_mod_N(BIGNUM *B, BIGNUM *N); 161 | 162 | # define SRP_MINIMAL_N 1024 163 | 164 | #ifdef __cplusplus 165 | } 166 | #endif 167 | 168 | # endif 169 | #endif 170 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | /* 67 | * client 68 | */ 69 | /* write to server */ 70 | # define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT) 71 | # define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT) 72 | /* read from server */ 73 | # define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT) 74 | # define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT) 75 | 76 | /* server */ 77 | /* read from client */ 78 | # define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT) 79 | # define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT) 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | #endif 85 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 | int num; 68 | char **data; 69 | int sorted; 70 | int num_alloc; 71 | int (*comp) (const void *, const void *); 72 | } _STACK; /* Use STACK_OF(...) instead */ 73 | 74 | # define M_sk_num(sk) ((sk) ? (sk)->num:-1) 75 | # define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) 76 | 77 | int sk_num(const _STACK *); 78 | void *sk_value(const _STACK *, int); 79 | 80 | void *sk_set(_STACK *, int, void *); 81 | 82 | _STACK *sk_new(int (*cmp) (const void *, const void *)); 83 | _STACK *sk_new_null(void); 84 | void sk_free(_STACK *); 85 | void sk_pop_free(_STACK *st, void (*func) (void *)); 86 | _STACK *sk_deep_copy(_STACK *, void *(*)(void *), void (*)(void *)); 87 | int sk_insert(_STACK *sk, void *data, int where); 88 | void *sk_delete(_STACK *st, int loc); 89 | void *sk_delete_ptr(_STACK *st, void *p); 90 | int sk_find(_STACK *st, void *data); 91 | int sk_find_ex(_STACK *st, void *data); 92 | int sk_push(_STACK *st, void *data); 93 | int sk_unshift(_STACK *st, void *data); 94 | void *sk_shift(_STACK *st); 95 | void *sk_pop(_STACK *st); 96 | void sk_zero(_STACK *st); 97 | int (*sk_set_cmp_func(_STACK *sk, int (*c) (const void *, const void *))) 98 | (const void *, const void *); 99 | _STACK *sk_dup(_STACK *st); 100 | void sk_sort(_STACK *st); 101 | int sk_is_sorted(const _STACK *st); 102 | 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | 107 | #endif 108 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/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 OPENSSL_STRING *OPENSSL_PSTRING; 81 | DECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) 82 | 83 | typedef struct txt_db_st { 84 | int num_fields; 85 | STACK_OF(OPENSSL_PSTRING) *data; 86 | LHASH_OF(OPENSSL_STRING) **index; 87 | int (**qual) (OPENSSL_STRING *); 88 | long error; 89 | long arg1; 90 | long arg2; 91 | OPENSSL_STRING *arg_row; 92 | } TXT_DB; 93 | 94 | # ifndef OPENSSL_NO_BIO 95 | TXT_DB *TXT_DB_read(BIO *in, int num); 96 | long TXT_DB_write(BIO *out, TXT_DB *db); 97 | # else 98 | TXT_DB *TXT_DB_read(char *in, int num); 99 | long TXT_DB_write(char *out, TXT_DB *db); 100 | # endif 101 | int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *), 102 | LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); 103 | void TXT_DB_free(TXT_DB *db); 104 | OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, 105 | OPENSSL_STRING *value); 106 | int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value); 107 | 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | 112 | #endif 113 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/ui_compat.h: -------------------------------------------------------------------------------- 1 | /* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ 2 | /* 3 | * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project 4 | * 2001. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 2001 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_UI_COMPAT_H 61 | # define HEADER_UI_COMPAT_H 62 | 63 | # include 64 | # include 65 | 66 | #ifdef __cplusplus 67 | extern "C" { 68 | #endif 69 | 70 | /* 71 | * The following functions were previously part of the DES section, and are 72 | * provided here for backward compatibility reasons. 73 | */ 74 | 75 | # define des_read_pw_string(b,l,p,v) \ 76 | _ossl_old_des_read_pw_string((b),(l),(p),(v)) 77 | # define des_read_pw(b,bf,s,p,v) \ 78 | _ossl_old_des_read_pw((b),(bf),(s),(p),(v)) 79 | 80 | int _ossl_old_des_read_pw_string(char *buf, int length, const char *prompt, 81 | int verify); 82 | int _ossl_old_des_read_pw(char *buf, char *buff, int size, const char *prompt, 83 | int verify); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | #endif 89 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/Headers/whrlpool.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_WHRLPOOL_H 2 | # define HEADER_WHRLPOOL_H 3 | 4 | # include 5 | # include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | # define WHIRLPOOL_DIGEST_LENGTH (512/8) 12 | # define WHIRLPOOL_BBLOCK 512 13 | # define WHIRLPOOL_COUNTER (256/8) 14 | 15 | typedef struct { 16 | union { 17 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 18 | /* double q is here to ensure 64-bit alignment */ 19 | double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)]; 20 | } H; 21 | unsigned char data[WHIRLPOOL_BBLOCK / 8]; 22 | unsigned int bitoff; 23 | size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)]; 24 | } WHIRLPOOL_CTX; 25 | 26 | # ifndef OPENSSL_NO_WHIRLPOOL 27 | # ifdef OPENSSL_FIPS 28 | int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 29 | # endif 30 | int WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 31 | int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes); 32 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits); 33 | int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c); 34 | unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md); 35 | # endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Socks/Library/Openssl/openssl.framework/openssl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Visitor-sos/iOS-Socks-SDK/b28a65c9050d86c3d6e0c21fc3fc8b4ed4ec3f3c/Socks/Library/Openssl/openssl.framework/openssl -------------------------------------------------------------------------------- /Socks/Library/Socks5/socks5.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define SOCKS_VERSION 0x05 4 | #define SOCKS_CMD_CONNECT 0x01 5 | #define SOCKS_IPV4 0x01 6 | #define SOCKS_DOMAIN 0x03 7 | #define SOCKS_IPV6 0x04 8 | #define SOCKS_CMD_NOT_SUPPORTED 0x07 9 | 10 | #pragma pack(1) 11 | 12 | struct method_select_request 13 | { 14 | char ver; 15 | char nmethods; 16 | char methods[255]; 17 | }; 18 | 19 | struct method_select_response 20 | { 21 | char ver; 22 | char method; 23 | }; 24 | 25 | struct socks5_request 26 | { 27 | char ver; 28 | char cmd; 29 | char rsv; 30 | char atyp; 31 | }; 32 | 33 | struct socks5_response 34 | { 35 | char ver; 36 | char rep; 37 | char rsv; 38 | char atyp; 39 | }; 40 | 41 | #pragma pack() 42 | 43 | -------------------------------------------------------------------------------- /Socks/Socks.h: -------------------------------------------------------------------------------- 1 | // 2 | // Socks.h 3 | // Socks 4 | // 5 | // Created by Visitor on 16/4/11. 6 | // Copyright © 2016年 Visitor. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "EVVerificationCode.h" 11 | #import "EVSocksClient.h" 12 | #import "EVProxyProtocol.h" 13 | 14 | // 该文件是整个SDK的头文件 15 | // 使用SDK时导入该文件即可 16 | 17 | // 在master分支对其进行了修改 18 | 19 | 20 | //! Project version number for Socks. 21 | FOUNDATION_EXPORT double SocksVersionNumber; 22 | 23 | //! Project version string for Socks. 24 | FOUNDATION_EXPORT const unsigned char SocksVersionString[]; 25 | 26 | // In this header, you should import all the public headers of your framework using statements like #import 27 | 28 | 29 | -------------------------------------------------------------------------------- /Socks/Utils.h: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.h 3 | // Socks 4 | // 5 | // Created by Visitor on 16/4/11. 6 | // Copyright © 2016年 Visitor. All rights reserved. 7 | // 8 | 9 | 10 | 11 | #define EVKey_SocksPassword @"socks_Password" //!< Socks Server Password 12 | #define EVKey_Client_TelNumber @"client_TelephoneNumber" //!< Client Telephone Number 13 | #define EVKey_Server_Address @"server_Address" //!< Login Server Address 14 | #define EVKey_TelephoneNumber @"telephoneNumber" //!< 本机电话号码 15 | 16 | #define SOCKS_Consult 10100 //!< Consult Tag 17 | #define SOCKS_AUTH_USERPASS 10500 //!< Username/Password Tag 18 | #define SOCKS_SERVER_RESPONSE 10600 //!< Socks Server 响应目标地址请求 19 | #define ADDR_STR_LEN 512 //!< url length 20 | 21 | 22 | #define EVServer_ResponseData_Register @"Server_ResponseData_Register" 23 | #define EVServer_ResponseData_VerifyCode @"Server_ResponseData_VerifyCode" 24 | #define EVServer_ResponseData_Login @"Server_ResponseData_Login" 25 | 26 | 27 | // operate NSUserDefault 28 | #define NSUserDefaultSet(object,key) [[NSUserDefaults standardUserDefaults] setObject:object forKey:key] 29 | #define NSUserDefaultObject(keys) [[NSUserDefaults standardUserDefaults] objectForKey:keys] 30 | #define NSUserDefault_Syn [[NSUserDefaults standardUserDefaults] synchronize] -------------------------------------------------------------------------------- /iamge1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Visitor-sos/iOS-Socks-SDK/b28a65c9050d86c3d6e0c21fc3fc8b4ed4ec3f3c/iamge1.png -------------------------------------------------------------------------------- /image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Visitor-sos/iOS-Socks-SDK/b28a65c9050d86c3d6e0c21fc3fc8b4ed4ec3f3c/image2.png -------------------------------------------------------------------------------- /image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Visitor-sos/iOS-Socks-SDK/b28a65c9050d86c3d6e0c21fc3fc8b4ed4ec3f3c/image3.png -------------------------------------------------------------------------------- /podfile: -------------------------------------------------------------------------------- 1 | 2 | pod 'SBJson', '~> 4.0.2' 3 | 4 | -------------------------------------------------------------------------------- /response.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Visitor-sos/iOS-Socks-SDK/b28a65c9050d86c3d6e0c21fc3fc8b4ed4ec3f3c/response.png --------------------------------------------------------------------------------