]> git.saurik.com Git - apple/security.git/blame - libsecurity_cryptkit/lib/mutils.m
Security-55471.14.18.tar.gz
[apple/security.git] / libsecurity_cryptkit / lib / mutils.m
CommitLineData
b1ab9ed8
A
1/* Copyright (c) 1998 Apple Computer, 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 COMPUTER, INC. AND THE
6 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE COMPUTER,
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 Doug Mitchell 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