module NmDatafile

A default schema is defined here… this needs to be converted into something more generic

Constants

SCHEMA
VERSION

Public Class Methods

new(config, *args) click to toggle source

config = {file_type: file_type, symmetric_key: symmetric_key}

# File lib/nm_datafile.rb, line 19
def self.new(config, *args)
  NmDatafile.new(config, *args)
end

Public Instance Methods

passfunc(hook, uid_hint, passphrase_info, prev_was_bad, fd) click to toggle source

This hack is for… some tricky bullshit, I forgot about

# File lib/nm_datafile/nm_datafile.rb, line 324
def passfunc(hook, uid_hint, passphrase_info, prev_was_bad, fd)
  $stderr.write("Passphrase for #{uid_hint}: ")
  $stderr.flush
  begin
    system('stty -echo')
    io = IO.for_fd(fd, 'w')
    io.puts(gets)
    io.flush
  ensure
    (0 ... $_.length).each do |i| $_[i] = ?0 end if $_
    system('stty echo')
  end
  $stderr.puts
end