Skip to content

Commit

Permalink
Swap cert-pem to pem-cert to match pfx syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
NeffIsBack committed Jan 22, 2025
1 parent 9511ca2 commit 80f528c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions nxc/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def gen_cli_args():
certificate_group.add_argument("--pfx-cert", metavar="PFXCERT", help="Use certificate authentication from pfx file .pfx")
certificate_group.add_argument("--pfx-base64", metavar="PFXB64", help="Use certificate authentication from pfx file encoded in base64")
certificate_group.add_argument("--pfx-pass", metavar="PFXPASS", help="Password of the pfx certificate")
certificate_group.add_argument("--cert-pem", metavar="CERTPEM", help="Use certificate authentication from PEM file")
certificate_group.add_argument("--key-pem", metavar="KEYPEM", help="Private key for the PEM format")
certificate_group.add_argument("--pem-cert", metavar="PEMCERT", help="Use certificate authentication from PEM file")
certificate_group.add_argument("--pem-key", metavar="PEMKEY", help="Private key for the PEM format")

server_group = std_parser.add_argument_group("Servers", "Options for nxc servers")
server_group.add_argument("--server", choices={"http", "https"}, default="https", help="use the selected server")
Expand Down
2 changes: 1 addition & 1 deletion nxc/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def login(self):
self.logger.info("Successfully authenticated using Kerberos cache")
return True

if self.args.pfx_cert or self.args.pfx_base64 or self.args.cert_pem:
if self.args.pfx_cert or self.args.pfx_base64 or self.args.pem_cert:
self.logger.debug("Trying to authenticate using Certificate pfx")
if not self.args.username:
self.logger.fail("You must specify a username when using certificate authentication")
Expand Down
4 changes: 2 additions & 2 deletions nxc/helpers/pfx.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,8 @@ def pfx_auth(self):
if self.args.pfx_cert or self.args.pfx_base64:
pfx = self.args.pfx_cert if self.args.pfx_cert else self.args.pfx_base64
ini = myPKINIT.from_pfx(pfx, self.args.pfx_pass, dhparams, bool(self.args.pfx_base64))
elif self.args.cert_pem and self.args.key_pem:
ini = myPKINIT.from_pem(self.args.cert_pem, self.args.key_pem, dhparams)
elif self.args.pem_cert and self.args.pem_key:
ini = myPKINIT.from_pem(self.args.pem_cert, self.args.pem_key, dhparams)
else:
self.logger.fail("You must either specify a PFX file + optional password or a combination of Cert PEM file and Private key PEM file")
return None
Expand Down

0 comments on commit 80f528c

Please sign in to comment.