Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

at_cram_single (digest in one command) #199

Merged

Conversation

JeremyTubongbanua
Copy link
Member

@JeremyTubongbanua JeremyTubongbanua commented Jun 25, 2022

- What I did

  • Create at_cram_single.dart to work with manual input for cram digesting
  • Add at_cram_single documentation to at_cram/README.md
  • Usage: dart bin/at_cram_single.dart <cramSecret> <challenge>

- How I did it
See at_cram_single.dart

- How to verify it

madiv@Jeremy-PC MINGW64 ~
$ openssl s_client -ign_eof -brief 06458a2c-8fda-50e6-b875-44e9db94db87.stagin001.atsign.zone:3920
@scan
data:["signing_publickey@comparativethe74"]
@from:@comparativethe74
data:_a4d3c1e4-7c90-4cc3-8e3e-078ec8eea3fa@comparativethe74:894cfa9b-94c1-46c2-9fc6-c527700151d4
@cram:a7d41fb832d623033bf6907b72b3476283d382ceb6acc4a3d5c2c3139c86b949a709062b73c63f40d00cf9a52b32dfe31b36400798d8b6b2645287ca2999a999
data:success
@comparativethe74@scan
data:["@comparativethe74:signing_privatekey@comparativethe74","public:signing_publickey@comparativethe74"]
@comparativethe74@
./cram_single c5544195f973eb40375f7f4b504ec631c35a8c7ec90e0a353242010880afac5bb6a9566be8d0f5947da697b5f01f651e92297622e49cf06844afb14d7c8e7a5d _a4d3c1e4-7c90-4cc3-8e3e-078ec8eea3fa@comparativethe74:894cfa9b-94c1-46c2-9fc6-c527700151d4

a7d41fb832d623033bf6907b72b3476283d382ceb6acc4a3d5c2c3139c86b949a709062b73c63f40d00cf9a52b32dfe31b36400798d8b6b2645287ca2999a999

- Description for the changelog

Copy link
Member

@cconstab cconstab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might also be a great idea to use

https://pub.dev/packages/args

to help with the command line code

Example here

https://github.com/atsign-foundation/sshnoports/blob/trunk/bin/sshnp.dart

@JeremyTubongbanua JeremyTubongbanua changed the title At cram single at_cram_single (digest in one command) Jun 28, 2022
@JeremyTubongbanua
Copy link
Member Author

@cconstab

Thank you for the feedback! :D
I've implemented ArgParser to at_cram's pubspec.yaml (c2d5752),

Implementation can be seen here: 27345ee

An example can be seen below

Incorrect usage output

> dart at_cram/bin/at_cram_single.dart -k c5544195f973eb40375f7f4b504ec631c35a8c7ec90e0a353242010880afac5bb6a9566be8d0f5947da697b5f01f651e92297622e49cf06844afb14d7c8e7a5d

CRAM digesting in one single line
  --cramSecret -k       | cramSecret received when you initially get an @ sign (usually in the form of a QR code)
  --challenge -c        | the challenge response you receive after doing `from:@youratsign`, will respond with `data:<challenge>`
  Example: `dart bin/at_cram_single.dart -k cramSecret123 -c fromChallenge123`

Correct usage output

> dart at_cram/bin/at_cram_single.dart -k c5544195f973eb40375f7f4b504ec631c35a8c7ec90e0a353242010880afac5bb6a9566be8d0f5947da697b5f01f651e92297622e49cf06844afb14d7c8e7a5d -c _a4d3c1e4-7c90-4cc3-8e3e-078ec8eea3fa@comparativethe74:894cfa9b-94c1-46c2-9fc6-c527700151d4

cramSecret: c5544195f973eb40375f7f4b504ec631c35a8c7ec90e0a353242010880afac5bb6a9566be8d0f5947da697b5f01f651e92297622e49cf06844afb14d7c8e7a5d
challenge: _a4d3c1e4-7c90-4cc3-8e3e-078ec8eea3fa@comparativethe74:894cfa9b-94c1-46c2-9fc6-c527700151d4

digest: a7d41fb832d623033bf6907b72b3476283d382ceb6acc4a3d5c2c3139c86b949a709062b73c63f40d00cf9a52b32dfe31b36400798d8b6b2645287ca2999a999

ArgParser to at_cram's pubspec.yaml:

> dart pub deps
Dart SDK 2.17.1
Flutter SDK 3.0.1
at_cram 1.1.0
|-- args 2.3.1
|-- lints 1.0.1
'-- test 1.21.3

@JeremyTubongbanua JeremyTubongbanua merged commit 62ee38f into atsign-foundation:trunk Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants