Skip to content

Commit 5e791e3

Browse files
committed
Fix issue with cupsCopyCredentialsKey when there was only the temporary private key stored.
1 parent 8de877b commit 5e791e3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

cups/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ all: $(TARGETS)
190190
#
191191

192192
test: $(UNITTARGETS)
193-
rm -f test.log test-debug.log
193+
rm -ff test.log test-debug.log .testssl
194194
date >test.log
195195
echo Running array API tests...
196196
./testarray 2>>test.log

cups/tls.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,18 @@ cupsCopyCredentials(
9393
// 'cupsCopyCredentialsKey()' - Copy the private key to a string.
9494
//
9595

96-
char *
96+
char * // O - PEM-encoded private key
9797
cupsCopyCredentialsKey(
9898
const char *path, // I - Directory path for certificate/key store or `NULL` for default
9999
const char *common_name) // I - Common name
100100
{
101-
return (http_copy_file(path, common_name, "key"));
101+
char *key = http_copy_file(path, common_name, "key");
102+
// Private key
103+
104+
if (!key)
105+
key = http_copy_file(path, common_name, "ktm");
106+
107+
return (key);
102108
}
103109

104110

0 commit comments

Comments
 (0)