| ︙ | | |
319
320
321
322
323
324
325
326
327
328
|
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
|
+
+
+
+
+
+
|
# directory (which may not actually exist).
#
set publicKeyFile EagleEnterprisePluginRootPublic.snk
}
#
# NOTE: If the configuration file exists, load it now.
#
set configFileName [file join $path sign.settings.eagle]
if {[file exists $configFileName]} then {source $configFileName}
#
# NOTE: The spacing to use before the embedded certificate. This
# must match up with the number of blank lines used with the
# [linsert] command used to help produce the final embedded
# certificate string (below).
|
| ︙ | | |
356
357
358
359
360
361
362
363
364
365
|
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
|
+
+
+
+
+
|
set shouldEmbed true
} else {
set shouldEmbed false
}
#
# HOOK: After all arguments have been parsed and processed.
#
catch {certificate_hook phase0}
#
# NOTE: The existing embedded certificate, if any, must be
# removed prior to signing the (script?) file.
#
if {$shouldEmbed} then {
|
| ︙ | | |
385
386
387
388
389
390
391
392
393
394
|
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
|
+
+
+
+
+
|
#
# NOTE: Import the license certificate.
#
set certificate [certificate import $fileName]
#
# HOOK: Post-certificate object creation (import).
#
catch {certificate_hook phase1}
#
# NOTE: Attempt to re-sign the license certificate file. Skip
# setting the Id as it should already be set correctly.
#
if {[certificate sign -encoding $encoding -settimestamp \
|
| ︙ | | |
428
429
430
431
432
433
434
435
436
437
|
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
|
+
+
+
+
+
|
# NOTE: Create an empty certificate object.
#
set certificate [object create -alias \
Licensing.Components.Public.Certificate]
#
# HOOK: Post-certificate object creation (create).
#
catch {certificate_hook phase1}
#
# NOTE: If the certificate vendor is available, set it.
#
if {[string length $vendor] > 0} then {
$certificate Vendor $vendor
|
| ︙ | | |
461
462
463
464
465
466
467
468
469
470
|
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
|
+
+
+
+
+
|
# NOTE: Set the entity value to the file contents that will, at
# some point, be seen by the script policy callback.
#
$certificate EntityValue [readEntityValue $fileName]
#
# HOOK: Post-certificate property setup (embedded).
#
catch {certificate_hook phase2}
#
# NOTE: Attempt to sign the embedded file certificate and place
# the Id, timestamp, public key token, and signature bytes
# into the certificate we created above.
#
|
| ︙ | | |
486
487
488
489
490
491
492
493
494
495
|
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
|
+
+
+
+
+
|
error [appendArgs \
"failed to verify embedded signature for " $fileType " \"" \
$fileName \"]
}
} else {
#
# HOOK: Post-certificate property setup (non-embedded).
#
catch {certificate_hook phase2}
#
# NOTE: Attempt to sign the data file and place the Id, timestamp,
# public key token, and signature bytes into the blank
# certificate we created above.
#
|
| ︙ | | |
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
|
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
|
+
+
+
+
+
-
-
+
+
-
-
-
-
+
+
+
+
|
puts stdout [appendArgs \
"added embedded certificate to " $fileType " \"" $fileName \"]
}
#
# HOOK: Script completion.
#
catch {certificate_hook phase3}
#
# NOTE: Play nice and cleanup all the variables we created during
# the whole the signing process.
# NOTE: Play nice and cleanup all the variables we created during the
# whole the signing process.
#
unset certificate privateKey publicKey embedSuffix embedPrefix; # dispose
unset privateKeyFile publicKeyFile certificateFile \
duration embed vendor fileName
unset -nocomplain fileName vendor embed duration entityType encoding \
privateKeyFile publicKeyFile configFileName embedSpacing embedPrefix \
embedSuffix publicKey privateKey shouldEmbed fileType certificate \
certificateFile data xmlNs xmlNsXsi xmlNsXsd spaces lines line
if {[info exists path_set]} then {
unset -nocomplain path path_set
}
} else {
usage ""
}
|