Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

adding an identity backup #65

Merged
merged 2 commits into from
Dec 25, 2023

Conversation

V0r-T3x
Copy link

@V0r-T3x V0r-T3x commented Dec 24, 2023

Description

A backup is created when the keys and fingerprint are generated. If the files are corrupted, the backups are loaded instead of a regenerate it. The pwnagotchi is protected.

Motivation and Context

In some crash cases, the key can be corrupted and the keys need to be generated again.
Pwnagotchi's identity protection commit

  • I have raised an issue to propose this change (required)

How Has This Been Tested?

It's already integrated since a while into fancygotchi. It served me well for all the crashed I caused while I developed my new features.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s

A backup is created when the keys and fingerprint are created. If the files are corrupted, the backup is loaded instead of generating the identity again. This is protecting the identity in case of crashes or corruptions.

Signed-off-by: V0r-T3x <[email protected]>
@jayofelony jayofelony self-requested a review December 24, 2023 08:37
Copy link
Owner

@jayofelony jayofelony left a comment

Choose a reason for hiding this comment

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

(f'{self.priv_path}.original')

What does the .original do exactly? Can you explain

And on line 30 there is a typo.

@V0r-T3x
Copy link
Author

V0r-T3x commented Dec 24, 2023

The backup file are marked with the .original file. They are saved in the same folder /etc/pwnagotchi/

Capture d'écran 2023-12-24 100201

@V0r-T3x
Copy link
Author

V0r-T3x commented Dec 24, 2023

I voluntary corrupted my id_rsa. here the log:

Capture d'écran 2023-12-24 100716

There is the initial error with the detection of this corrupted key, followed with the loading backup, and the load continue as intended.

@jayofelony jayofelony merged commit ef120e0 into jayofelony:pwnagotchi-torch Dec 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants