Skip to content
This repository has been archived by the owner on Jan 30, 2018. It is now read-only.

updated a lot - I think it still all works #57

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
41 changes: 18 additions & 23 deletions CreateUserPkg.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
0596D196159AF27800B898B4 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0596D194159AF27800B898B4 /* MainMenu.xib */; };
05CF2A17159DE745004F36C8 /* CUPImageSelector.m in Sources */ = {isa = PBXBuildFile; fileRef = 05CF2A16159DE745004F36C8 /* CUPImageSelector.m */; };
05CF2A1A159DEDE4004F36C8 /* dropimagehere.png in Resources */ = {isa = PBXBuildFile; fileRef = 05CF2A19159DEDE4004F36C8 /* dropimagehere.png */; };
6605E68A159B86480048362A /* CUPBestHostFinder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6605E689159B86480048362A /* CUPBestHostFinder.m */; };
6605E68E159B90070048362A /* CUPAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6605E68D159B90070048362A /* CUPAppDelegate.m */; };
6605E695159B964D0048362A /* CUPUIDFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6605E690159B964D0048362A /* CUPUIDFormatter.m */; };
6605E696159B964D0048362A /* CUPUserNameFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6605E692159B964D0048362A /* CUPUserNameFormatter.m */; };
6605E697159B964D0048362A /* CUPUUIDFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6605E694159B964D0048362A /* CUPUUIDFormatter.m */; };
66B221D8159C4C30003FDF4E /* CreateUserPkg.icns in Resources */ = {isa = PBXBuildFile; fileRef = 66B221D7159C4C30003FDF4E /* CreateUserPkg.icns */; };
C09EAB201EF8EDFE005A8859 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C09EAB1F1EF8EDFE005A8859 /* Security.framework */; };
C7D85C7E1EF9BCEF00936FD0 /* CUPKeys.m in Sources */ = {isa = PBXBuildFile; fileRef = C7D85C7D1EF9BCEF00936FD0 /* CUPKeys.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -47,24 +47,24 @@
05CF2A15159DE745004F36C8 /* CUPImageSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CUPImageSelector.h; sourceTree = "<group>"; };
05CF2A16159DE745004F36C8 /* CUPImageSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CUPImageSelector.m; sourceTree = "<group>"; };
05CF2A19159DEDE4004F36C8 /* dropimagehere.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dropimagehere.png; sourceTree = "<group>"; };
6605E688159B86480048362A /* CUPBestHostFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CUPBestHostFinder.h; sourceTree = "<group>"; };
6605E689159B86480048362A /* CUPBestHostFinder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CUPBestHostFinder.m; sourceTree = "<group>"; };
6605E68C159B90070048362A /* CUPAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CUPAppDelegate.h; sourceTree = "<group>"; };
6605E68D159B90070048362A /* CUPAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CUPAppDelegate.m; sourceTree = "<group>"; };
6605E68F159B964D0048362A /* CUPUIDFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CUPUIDFormatter.h; sourceTree = "<group>"; };
6605E690159B964D0048362A /* CUPUIDFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CUPUIDFormatter.m; sourceTree = "<group>"; };
6605E691159B964D0048362A /* CUPUserNameFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CUPUserNameFormatter.h; sourceTree = "<group>"; };
6605E692159B964D0048362A /* CUPUserNameFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CUPUserNameFormatter.m; sourceTree = "<group>"; };
6605E693159B964D0048362A /* CUPUUIDFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CUPUUIDFormatter.h; sourceTree = "<group>"; };
6605E694159B964D0048362A /* CUPUUIDFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CUPUUIDFormatter.m; sourceTree = "<group>"; };
66B221D7159C4C30003FDF4E /* CreateUserPkg.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = CreateUserPkg.icns; sourceTree = "<group>"; };
C09EAB1F1EF8EDFE005A8859 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = ../../../../System/Library/Frameworks/Security.framework; sourceTree = "<group>"; };
C7D85C7C1EF9BCEF00936FD0 /* CUPKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CUPKeys.h; sourceTree = "<group>"; };
C7D85C7D1EF9BCEF00936FD0 /* CUPKeys.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CUPKeys.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
0596D175159AF27800B898B4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C09EAB201EF8EDFE005A8859 /* Security.framework in Frameworks */,
0596D17D159AF27800B898B4 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -102,6 +102,7 @@
0596D17E159AF27800B898B4 /* Other Frameworks */ = {
isa = PBXGroup;
children = (
C09EAB1F1EF8EDFE005A8859 /* Security.framework */,
0596D17F159AF27800B898B4 /* AppKit.framework */,
0596D180159AF27800B898B4 /* CoreData.framework */,
0596D181159AF27800B898B4 /* Foundation.framework */,
Expand All @@ -113,15 +114,13 @@
isa = PBXGroup;
children = (
0596D19C159AF2A200B898B4 /* CreateUserPkg.entitlements */,
6605E68C159B90070048362A /* CUPAppDelegate.h */,
6605E68D159B90070048362A /* CUPAppDelegate.m */,
6605E688159B86480048362A /* CUPBestHostFinder.h */,
6605E689159B86480048362A /* CUPBestHostFinder.m */,
05CF2A15159DE745004F36C8 /* CUPImageSelector.h */,
05CF2A16159DE745004F36C8 /* CUPImageSelector.m */,
0596D18E159AF27800B898B4 /* CUPDocument.h */,
0596D18F159AF27800B898B4 /* CUPDocument.m */,
0596D191159AF27800B898B4 /* CUPDocument.xib */,
C7D85C7C1EF9BCEF00936FD0 /* CUPKeys.h */,
C7D85C7D1EF9BCEF00936FD0 /* CUPKeys.m */,
6605E68F159B964D0048362A /* CUPUIDFormatter.h */,
6605E690159B964D0048362A /* CUPUIDFormatter.m */,
6605E691159B964D0048362A /* CUPUserNameFormatter.h */,
Expand Down Expand Up @@ -180,11 +179,6 @@
CLASSPREFIX = CUP;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = "University of Gothenburg";
TargetAttributes = {
0596D177159AF27800B898B4 = {
DevelopmentTeam = 5KQ3D3FG5H;
};
};
};
buildConfigurationList = 0596D172159AF27800B898B4 /* Build configuration list for PBXProject "CreateUserPkg" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -259,10 +253,9 @@
files = (
0596D189159AF27800B898B4 /* main.m in Sources */,
0596D190159AF27800B898B4 /* CUPDocument.m in Sources */,
6605E68A159B86480048362A /* CUPBestHostFinder.m in Sources */,
6605E68E159B90070048362A /* CUPAppDelegate.m in Sources */,
6605E695159B964D0048362A /* CUPUIDFormatter.m in Sources */,
6605E696159B964D0048362A /* CUPUserNameFormatter.m in Sources */,
C7D85C7E1EF9BCEF00936FD0 /* CUPKeys.m in Sources */,
6605E697159B964D0048362A /* CUPUUIDFormatter.m in Sources */,
05CF2A17159DE745004F36C8 /* CUPImageSelector.m in Sources */,
);
Expand Down Expand Up @@ -377,13 +370,14 @@
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = CreateUserPkg/CreateUserPkg.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "CreateUserPkg/CreateUserPkg-Prefix.pch";
INFOPLIST_FILE = "CreateUserPkg/CreateUserPkg-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.7;
MACOSX_DEPLOYMENT_TARGET = 10.8;
PRODUCT_BUNDLE_IDENTIFIER = "se.gu.it.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
Expand All @@ -396,13 +390,14 @@
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = CreateUserPkg/CreateUserPkg.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "CreateUserPkg/CreateUserPkg-Prefix.pch";
INFOPLIST_FILE = "CreateUserPkg/CreateUserPkg-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.7;
MACOSX_DEPLOYMENT_TARGET = 10.8;
PRODUCT_BUNDLE_IDENTIFIER = "se.gu.it.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
Expand Down
13 changes: 0 additions & 13 deletions CreateUserPkg/CUPAppDelegate.h

This file was deleted.

19 changes: 0 additions & 19 deletions CreateUserPkg/CUPAppDelegate.m

This file was deleted.

20 changes: 0 additions & 20 deletions CreateUserPkg/CUPBestHostFinder.h

This file was deleted.

58 changes: 0 additions & 58 deletions CreateUserPkg/CUPBestHostFinder.m

This file was deleted.

68 changes: 1 addition & 67 deletions CreateUserPkg/CUPDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import "CUPBestHostFinder.h"
#import "CUPImageSelector.h"


@interface CUPDocument : NSDocument {
NSWindow *__unsafe_unretained docWindow;

CUPImageSelector *__unsafe_unretained _image;
NSTextField *__unsafe_unretained _fullName;
NSTextField *__unsafe_unretained _accountName;
NSSecureTextField *__unsafe_unretained _password;
NSSecureTextField *__unsafe_unretained _verifyPassword;
NSTextField *__unsafe_unretained _userID;
NSPopUpButton *__unsafe_unretained _accountType;
NSTextField *__unsafe_unretained _homeDirectory;
NSTextField *__unsafe_unretained _uuid;
NSButton *__unsafe_unretained _automaticLogin;

NSTextField *__unsafe_unretained _packageID;
NSTextField *__unsafe_unretained _version;

NSMutableString *_shadowHash;
NSData *_kcPassword;
NSMutableDictionary *_docState;
}

@property (unsafe_unretained) IBOutlet NSWindow *docWindow;

@property (unsafe_unretained) IBOutlet NSTextField *fullName;
@property (unsafe_unretained) IBOutlet NSTextField *accountName;
@property (unsafe_unretained) IBOutlet CUPImageSelector *image;
@property (unsafe_unretained) IBOutlet NSSecureTextField *password;
@property (unsafe_unretained) IBOutlet NSSecureTextField *verifyPassword;
@property (unsafe_unretained) IBOutlet NSTextField *userID;
@property (unsafe_unretained) IBOutlet NSPopUpButton *accountType;
@property (unsafe_unretained) IBOutlet NSTextField *homeDirectory;
@property (unsafe_unretained) IBOutlet NSTextField *uuid;
@property (unsafe_unretained) IBOutlet NSButton *automaticLogin;

@property (unsafe_unretained) IBOutlet NSTextField *packageID;
@property (unsafe_unretained) IBOutlet NSTextField *version;

@property (strong) NSMutableString *shadowHash;
@property (strong) NSData *kcPassword;
@property (strong) NSMutableDictionary *docState;

- (IBAction)didLeaveFullName:(id)sender;
- (IBAction)didLeaveAccountName:(id)sender;
- (IBAction)didLeavePassword:(id)sender;

- (void)calculateShadowHash:(NSString *)pwd;
- (void)calculateKCPassword:(NSString *)pwd;
- (void)setTextField:(NSTextField *)field withKey:(NSString *)key;
- (void)setDocStateKey:(NSString *)key fromDict:(NSDictionary *)dict;
- (BOOL)validateField:(NSControl *)field validator:(BOOL (^)(NSControl *))valFunc errorMsg:(NSString *)msg;
- (BOOL)validateDocumentAndUpdateState;
- (NSDictionary *)newDictFromScript:(NSString *)path withArgs:(NSDictionary *)argDict error:(NSError **)outError;

#define SALTED_SHA1_LEN 48
#define SALTED_SHA1_OFFSET (64 + 40 + 64)
#define SHADOW_HASH_LEN 1240

#define CUP_PASSWORD_PLACEHOLDER @"SEIPHATSXSTX$D418JMPC000"

enum {
ACCOUNT_TYPE_STANDARD = 0,
ACCOUNT_TYPE_ADMIN
};
@interface CUPDocument : NSDocument

@end
Loading