Skip to content
This repository was archived by the owner on Mar 28, 2018. It is now read-only.

Commit 6ef3166

Browse files
committed
Merge branch 'issues/ndn-0004-pubcert-error'
* issues/ndn-0004-pubcert-error: C-API: Suppress confusing warning when .pubcert file does not exist Refs #4
2 parents 67574be + 997b6e1 commit 6ef3166

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

csrc/lib/ccn_keystore.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ ccn_keystore_init_pubcert(struct ccn_keystore *p, const char *keystoreFilename)
161161
}
162162

163163
if (res <= 0 || d->state < 0) {
164-
fprintf (stderr, "ERROR: [%s] file exists, but does not contain valid certification of the public key or key meta info\n",
164+
fprintf (stderr, "WARNING: [%s] file exists, but does not contain valid certification of the public key or key meta info\n",
165165
pubcert_file);
166166

167167
ccn_charbuf_destroy(&p->pubkey_content_object);
@@ -192,7 +192,7 @@ ccn_keystore_init_pubcert(struct ccn_keystore *p, const char *keystoreFilename)
192192
res = 1;
193193
}
194194
else {
195-
fprintf (stderr, "ERROR: [%s] contains a valid key object, but it does not match used private/public key\n",
195+
fprintf (stderr, "WARNING: [%s] contains a valid key object, but it does not match used private/public key\n",
196196
pubcert_file);
197197
res = -1;
198198
}
@@ -224,13 +224,13 @@ ccn_keystore_init_pubcert(struct ccn_keystore *p, const char *keystoreFilename)
224224
}
225225
else {
226226
res = -1;
227-
fprintf (stderr, "ERROR: [%s] contains a valid ContentObject, but it is not a KEY object\n",
227+
fprintf (stderr, "WARNING: [%s] contains a valid ContentObject, but it is not a KEY object\n",
228228
pubcert_file);
229229
}
230230
}
231231

232232
if (res >= 0 && !valid_name) {
233-
fprintf (stderr, "ERROR: [%s] contains a valid ContentObject, but its name does not conform to NDN key naming\n",
233+
fprintf (stderr, "WARNING: [%s] contains a valid ContentObject, but its name does not conform to NDN key naming\n",
234234
pubcert_file);
235235
fprintf (stderr, " Allow to proceed, but public key name's correctness is not guaranteed\n");
236236
}
@@ -253,8 +253,8 @@ ccn_keystore_init_pubcert(struct ccn_keystore *p, const char *keystoreFilename)
253253
/* } */
254254
return 0;
255255
}
256-
else {
257-
perror(pubcert_file);
256+
else {
257+
//perror(pubcert_file);
258258
return 1;
259259
}
260260
free(pubcert_file);

0 commit comments

Comments
 (0)