1/* Copyright (c) 1998,2011,2014 Apple Inc. All Rights Reserved. 2 * 3 * NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT 4 * TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE 5 * SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE, INC. AND THE 6 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE, 7 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL 8 * EXPOSE YOU TO LIABILITY. 9 *************************************************************************** 10 * 11 * mutils.m - general private ObjC routine declarations 12 * 13 * Revision History 14 * ---------------- 15 * 2 Aug 96 at NeXT 16 * Broke out from Blaine Garst's original NSCryptors.m 17 */ 18 19#import <Foundation/Foundation.h> 20#import "giantIntegers.h" 21#import "ckutilities.h" 22#import "mutils.h" 23#import "feeFunctions.h" 24#import <libc.h> 25 26#if defined(NeXT) && !defined(WIN32) 27 28/* 29 * Public, declared in NSCryptors.h 30 */ 31NSString *NSPromptForPassPhrase(NSString *prompt) { 32 // useful for command line (/dev/tty) programs 33 char buffer[PHRASELEN]; 34 NSString *result; 35 36 getpassword([prompt cString], buffer); 37 if (buffer[0] == 0) return nil; 38 result = [NSString stringWithCString:buffer]; 39 bzero(buffer, PHRASELEN); 40 return result; 41} 42 43 44#endif NeXT 45