Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • L libotr
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 50
    • Issues 50
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Libraries
  • libotr
  • Issues
  • #84

Closed
Open
Created Apr 01, 2016 by cypherpunks@cypherpunks

libotr, pidgin-otr drop ALL private keys when interrupted during key generation

This is due to the opening of the file using the "w+" mode - which truncates the file. There is a potentially long time when the new key is generated during which the file remains empty. Only after that, all the private keys are rewritten to the file.

The IMPACT of it happening is pretty serious, requiring new keys, reauthentication and bootstrapping for all contacts for every account. One must be lucky to be able to restore the truncated data from filesystem, before the libs try to overwrite it automatically on the next chat contact with new keys. The likelihood of this bug happening is obiously small.

I propose the patches in the attachment, which are hereby under the LGPL. This affects pidgin-otr and possibly other projects too, which use this api with "w+". This patch doesn't prevent the api user from going the w+ way, thus compatibility preserving.

What do you think? Not sure about the Priority...

STEPS TO REPRODUCE:

cat $priv_file;

click generate key in e.g. pidgin && kill -KILL pidgin

cat $priv_file.

(from redmine: created on 2015-03-04)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking