CryptoPassphrase  Check-in [398614baea]

Overview
Comment:Adjust to ObjFW changes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 398614baea93bf591541e606de8ffa347d61e058ab6e3abe16766481f7f3e6a6
User & Date: js on 2017-04-15 17:56:14
Other Links: manifest | tags
Context
2017-04-15
19:23
Fix URL in copyright header check-in: 4514c363cd user: js tags: trunk
17:56
Adjust to ObjFW changes check-in: 398614baea user: js tags: trunk
2017-01-08
01:53
Update Xcode project to Xcode 8.2 check-in: 7bce58e62b user: js tags: trunk
Changes

Modified Makefile from [b8bcd53354] to [c3d8bf191d].

1
2
3
4
5
all:
	@objfw-compile -o scrypt-pwgen *.m

clean:
	rm -f *.o *~ scrypt-pwgen

|



1
2
3
4
5
all:
	@objfw-compile -Werror -o scrypt-pwgen *.m

clean:
	rm -f *.o *~ scrypt-pwgen

Modified ScryptPWGen.m from [2b9964b6fe] to [432f428096].

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
	generator.site = [[optionsParser remainingArguments] firstObject];

	if (lengthStr != nil) {
		bool invalid = false;

		@try {
			generator.length = (size_t)[lengthStr decimalValue];
		} @catch (OFInvalidArgumentException *e) {
			invalid = true;
		} @catch (OFInvalidFormatException *e) {
			invalid = true;
		}

		if (invalid) {
			[of_stderr writeFormat:
			    @"%@: Invalid length: %@\n",
			    [OFApplication programName], lengthStr];

			[OFApplication terminateWithStatus: 1];
		}
	}


	prompt = [OFString stringWithFormat: @"Passphrase for site \"%@\": ",
					     generator.site];
	passphrase = getpass(
	    [prompt cStringWithEncoding: [OFSystemInfo native8BitEncoding]]);
	@try {
		if (_repeat) {
			char *passphraseCopy = of_strdup(passphrase);

			if (passphraseCopy == NULL)
				@throw [OFOutOfMemoryException exception];

			@try {
				of_string_encoding_t encoding =
				    [OFSystemInfo native8BitEncoding];

				prompt = [OFString stringWithFormat:
				    @"Repeat passphrase for site \"%@\": ",
				    generator.site];
				passphrase = getpass(
				    [prompt cStringWithEncoding: encoding]);








|

|
















|









|







113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
	generator.site = [[optionsParser remainingArguments] firstObject];

	if (lengthStr != nil) {
		bool invalid = false;

		@try {
			generator.length = (size_t)[lengthStr decimalValue];
		} @catch (OFInvalidFormatException *e) {
			invalid = true;
		} @catch (OFOutOfRangeException *e) {
			invalid = true;
		}

		if (invalid) {
			[of_stderr writeFormat:
			    @"%@: Invalid length: %@\n",
			    [OFApplication programName], lengthStr];

			[OFApplication terminateWithStatus: 1];
		}
	}


	prompt = [OFString stringWithFormat: @"Passphrase for site \"%@\": ",
					     generator.site];
	passphrase = getpass(
	    [prompt cStringWithEncoding: [OFLocalization encoding]]);
	@try {
		if (_repeat) {
			char *passphraseCopy = of_strdup(passphrase);

			if (passphraseCopy == NULL)
				@throw [OFOutOfMemoryException exception];

			@try {
				of_string_encoding_t encoding =
				    [OFLocalization encoding];

				prompt = [OFString stringWithFormat:
				    @"Repeat passphrase for site \"%@\": ",
				    generator.site];
				passphrase = getpass(
				    [prompt cStringWithEncoding: encoding]);