This repository was archived by the owner on Jan 29, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +47
-10
lines changed Expand file tree Collapse file tree 2 files changed +47
-10
lines changed Original file line number Diff line number Diff line change @@ -301,15 +301,33 @@ xm_end_chain(const br_x509_class **ctx)
301
301
br_x509_minimal_context * cc ;
302
302
303
303
cc = (br_x509_minimal_context * )(void * )ctx ;
304
- if (cc -> err == 0 ) {
305
- if (cc -> num_certs == 0 ) {
304
+
305
+ if (cc -> err == 0 )
306
+ {
307
+ if (cc -> num_certs == 0 )
308
+ {
306
309
cc -> err = BR_ERR_X509_EMPTY_CHAIN ;
307
- } else {
308
- cc -> err = BR_ERR_X509_NOT_TRUSTED ;
310
+ }
311
+ else
312
+ {
313
+ // KH mod to permit BR_ERR_X509_NOT_TRUSTED
314
+ #if 1 //PERMIT_X509_NOT_TRUSTED
315
+
316
+ //cc->err = BR_ERR_X509_NOT_TRUSTED;
317
+ cc -> err = BR_ERR_X509_OK ;
318
+ return 0 ;
319
+
320
+ #else
321
+ cc -> err = BR_ERR_X509_NOT_TRUSTED ;
322
+ #endif
323
+ //////
309
324
}
310
- } else if (cc -> err == BR_ERR_X509_OK ) {
325
+ }
326
+ else if (cc -> err == BR_ERR_X509_OK )
327
+ {
311
328
return 0 ;
312
329
}
330
+
313
331
return (unsigned )cc -> err ;
314
332
}
315
333
@@ -319,6 +337,7 @@ xm_get_pkey(const br_x509_class *const *ctx, unsigned *usages)
319
337
br_x509_minimal_context * cc ;
320
338
321
339
cc = (br_x509_minimal_context * )(void * )ctx ;
340
+
322
341
if (cc -> err == BR_ERR_X509_OK
323
342
|| cc -> err == BR_ERR_X509_NOT_TRUSTED )
324
343
{
Original file line number Diff line number Diff line change @@ -250,15 +250,33 @@ xm_end_chain(const br_x509_class **ctx)
250
250
br_x509_minimal_context *cc;
251
251
252
252
cc = (br_x509_minimal_context *)(void *)ctx;
253
- if (cc->err == 0) {
254
- if (cc->num_certs == 0) {
253
+
254
+ if (cc->err == 0)
255
+ {
256
+ if (cc->num_certs == 0)
257
+ {
255
258
cc->err = BR_ERR_X509_EMPTY_CHAIN;
256
- } else {
257
- cc->err = BR_ERR_X509_NOT_TRUSTED;
259
+ }
260
+ else
261
+ {
262
+ // KH mod to permit BR_ERR_X509_NOT_TRUSTED
263
+ #if 1 //PERMIT_X509_NOT_TRUSTED
264
+
265
+ //cc->err = BR_ERR_X509_NOT_TRUSTED;
266
+ cc->err = BR_ERR_X509_OK;
267
+ return 0;
268
+
269
+ #else
270
+ cc->err = BR_ERR_X509_NOT_TRUSTED;
271
+ #endif
272
+ //////
258
273
}
259
- } else if (cc->err == BR_ERR_X509_OK) {
274
+ }
275
+ else if (cc->err == BR_ERR_X509_OK)
276
+ {
260
277
return 0;
261
278
}
279
+
262
280
return (unsigned)cc->err;
263
281
}
264
282
You can’t perform that action at this time.
0 commit comments