Opened 5 years ago

Closed 5 years ago

#8800 closed enhancement (fixed)

Make facilitator public key configurable

Reported by: dcf Owned by: dcf
Priority: Medium Milestone:
Component: Archived/Flashproxy Version:
Severity: Keywords:
Cc: arma, ln5 Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

The FACILITATOR_PUBLIC_KEY is hardcoded in the registration helpers flashproxy-reg-email and flashproxy-reg-url. It won't work for any facilitator but the one at fp-facilitator.org.

It should be configurable from the command line so that you can easily test with another facilitator.

./flashproxy-reg-email --facilitator-pubkey key.asc

This configurable public key corresponds to the private key that is given to flashproxy-reg-daemon with the --key option.

Child Tickets

Attachments (4)

Change History (14)

comment:1 Changed 5 years ago by arma

Cc: arma added

comment:2 Changed 5 years ago by arlolra

Status: newneeds_review

Attached a patch for this, though I just realized you wanted the option to take a filename, not a string. I suppose you could "cat key.asc" in the meantime, but I'll rework it as desired.

Changed 5 years ago by arlolra

comment:3 Changed 5 years ago by arlolra

Done. Second patch builds on the first.

comment:4 Changed 5 years ago by dcf

Status: needs_reviewneeds_revision

Thanks for the quick patches.

-    options.facilitator_publickey_pem = a
+    options.facilitator_publickey_pem = open(a, "r").read()

I don't like this. Better to have the global option be called options.facilitator_pubkey_filename with a default value of None. Then provide an abstraction get_facilitator_pubkey. get_facilitator_pubkey checks the value of options.facilitator_pubkey_filename. If the file name is None, it return the result of calling RSA.load_pub_key_bio on a memory buffer containing DEFAULT_FACILITATOR_PUBKEY_PEM, as is done now. If the file name is not None, it returns the result of calling RSA.load_pub_key on the file name.

comment:5 Changed 5 years ago by arlolra

That makes sense. See the attached 3rd patch.

comment:6 Changed 5 years ago by arlolra

Status: needs_revisionneeds_review

comment:7 Changed 5 years ago by dcf

Status: needs_reviewneeds_revision

Thanks. I committed your patches, and then made some changes myself.

Two things are left to do:

  1. Add the --facilitator-pubkey option to flashproxy-client, which will pass the option to the appropriate registration helpers in the build_register_command function.
  2. Document the new options in the doc/*.txt man page source files.

comment:8 Changed 5 years ago by ln5

Cc: ln5 added

comment:9 Changed 5 years ago by arlolra

Status: needs_revisionneeds_review

New patch attched based on master for the above 2 things.
I took the liberty of regenerating the man pages, hope that's alright.

comment:10 Changed 5 years ago by dcf

Resolution: fixed
Status: needs_reviewclosed

Thanks, committed.

Note: See TracTickets for help on using tickets.