Permalink
Browse files

libgcrypt iOS 5.1 compatibility

dynamic version in about screen
  • Loading branch information...
1 parent 46cdb26 commit bc252950069bef9e0bed5d95588f1af2baabb435 @x2on committed May 29, 2012
View
@@ -0,0 +1,29 @@
+//
+// VersionHelper.h
+// libssh2-for-iOS
+//
+// Created by Schulze Felix on 29.05.12.
+// Copyright 2012 Felix Schulze. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#import <Foundation/Foundation.h>
+
+@interface VersionHelper : NSObject
+
++ (NSString *) opensslVersion;
++ (NSString *) libssh2Version;
++ (NSString *) libgpgerrorVersion;
++ (NSString *) libgcryptVersion;
+
+@end
View
@@ -0,0 +1,43 @@
+//
+// VersionHelper.m
+// libssh2-for-iOS
+//
+// Created by Schulze Felix on 29.05.12.
+// Copyright 2012 Felix Schulze. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#import "VersionHelper.h"
+#include <openssl/opensslv.h>
+#include "libssh2.h"
+#include "gcrypt.h"
+
+@implementation VersionHelper
+
++ (NSString *) opensslVersion {
+ return [NSString stringWithCString:OPENSSL_VERSION_TEXT encoding:NSUTF8StringEncoding];
+}
+
++ (NSString *) libssh2Version {
+ return [NSString stringWithCString:LIBSSH2_VERSION encoding:NSUTF8StringEncoding];
+}
+
++ (NSString *) libgpgerrorVersion {
+ return @"1.10";
+}
+
++ (NSString *) libgcryptVersion {
+ return [NSString stringWithCString:GCRYPT_VERSION encoding:NSUTF8StringEncoding];
+}
+
+@end
@@ -18,8 +18,7 @@
// limitations under the License.
#import "libssh2_for_iOSAppDelegate.h"
-#include <openssl/opensslv.h>
-#include "libssh2.h"
+#import "VersionHelper.h"
#import "SSHWrapper.h"
@implementation libssh2_for_iOSAppDelegate
@@ -54,9 +53,7 @@ - (IBAction)executeCommand:(id)sender {
- (IBAction)showInfo {
- NSString *opensslVersion = [NSString stringWithCString:OPENSSL_VERSION_TEXT encoding:NSUTF8StringEncoding];
- NSString *libssh2Version = [NSString stringWithCString:LIBSSH2_VERSION encoding:NSUTF8StringEncoding];
- NSString *message = [NSString stringWithFormat:@"libssh2-Version: %@\nlibgcrypt-Version: 1.5.0\nlibgpg-error-Version: 1.10\nopenssl-Version: %@\n\nLicense: See include/*/LICENSE\n\nCopyright 2011-2012 by Felix Schulze\n http://www.x2on.de", libssh2Version, opensslVersion];
+ NSString *message = [NSString stringWithFormat:@"libssh2-Version: %@\nlibgcrypt-Version: %@\nlibgpg-error-Version: %@\nopenssl-Version: %@\n\nLicense: See include/*/LICENSE\n\nCopyright 2011-2012 by Felix Schulze\n http://www.x2on.de", [VersionHelper libssh2Version], [VersionHelper libgcryptVersion], [VersionHelper libgpgerrorVersion], [VersionHelper opensslVersion]];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"libssh2-for-iOS" message:message delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil];
[alert show];
[alert release];
View
@@ -22,7 +22,7 @@
# Change values here
#
VERSION="1.5.0"
-SDKVERSION="5.0"
+SDKVERSION="5.1"
#
###########################################################################
#
View
@@ -22,7 +22,7 @@
# Change values here
#
VERSION="1.10"
-SDKVERSION="5.0"
+SDKVERSION="5.1"
#
###########################################################################
#
@@ -21,6 +21,7 @@
2AB446ED12F8A588006B0090 /* libssh2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AB446E812F8A588006B0090 /* libssh2.a */; };
2AB446EE12F8A588006B0090 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AB446E912F8A588006B0090 /* libssl.a */; };
2AB4470112F8A5B5006B0090 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AB4470012F8A5B5006B0090 /* libz.dylib */; };
+ 53CF39D3157546170079DAC3 /* VersionHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 53CF39D2157546170079DAC3 /* VersionHelper.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -43,6 +44,8 @@
2AB446F312F8A5A3006B0090 /* libssh2_for_iOS-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "libssh2_for_iOS-Info.plist"; sourceTree = "<group>"; };
2AB4470012F8A5B5006B0090 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
2AB4470612F8A5CC006B0090 /* libssh2_for_iOS_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libssh2_for_iOS_Prefix.pch; sourceTree = "<group>"; };
+ 53CF39D1157546170079DAC3 /* VersionHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VersionHelper.h; sourceTree = "<group>"; };
+ 53CF39D2157546170079DAC3 /* VersionHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VersionHelper.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -72,6 +75,8 @@
1D3623250D0F684500981E51 /* libssh2_for_iOSAppDelegate.m */,
2A5385E312F8A890007E067A /* SSHWrapper.h */,
2A5385E412F8A890007E067A /* SSHWrapper.m */,
+ 53CF39D1157546170079DAC3 /* VersionHelper.h */,
+ 53CF39D2157546170079DAC3 /* VersionHelper.m */,
);
path = Classes;
sourceTree = "<group>";
@@ -198,6 +203,7 @@
1D3623260D0F684500981E51 /* libssh2_for_iOSAppDelegate.m in Sources */,
2A3B48BC12F897D600F428E7 /* main.m in Sources */,
2A5385E512F8A890007E067A /* SSHWrapper.m in Sources */,
+ 53CF39D3157546170079DAC3 /* VersionHelper.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

0 comments on commit bc25295

Please sign in to comment.