summaryrefslogtreecommitdiff
path: root/docs/NOTES-python-gnupg-development.org
blob: 3ea6b6b7bcc6552c8d8cd4e2b191603edfa4a8d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
-*- mode: org; epa-file-encrypt-to: ("isis@leap.se") -*-
#+TITLE:     python-gnupg audit
#+AUTHOR:    isis
#+EMAIL:     isis@leap.se
#+DATE:      2013-02-01 Fri
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:2 ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:   
#+LINK_HOME: 
#+XSLT:

* Development notes on patching python-gnupg

** python-gnupg

** Sphinx & documentation
*** Obtaining full .rst documentation from Sphinx

Internally, Sphinx prepares and uses ReStructed Text to create the other
formats, but provides no functionality for obtaining it. To steal it from
Sphinx, we can patch the Sphinx source to print it to stdout and then pipe that
to a file.

The patch for Sphinx is (from http://stackoverflow.com/a/2712413) changes
Sphinx's `sphinx.ext.autodoc.Documenter.add__line` function to:

#+BEGIN_SRC python
def add_line(self, line, source, *lineno):
    """Append one line of generated reST to the output."""
    print self.indent + line
    self.directive.result.append(self.indent + line, source, *lineno)))
#+END_SRC

* Resources

** On the ctb=%d.02 bug
This bug can be triggered in several versions of GnuPG, and will result in a 
message similar to:

gpg: [don't know]: invalid packet (ctb=2d)
gpg: [don't know]: invalid packet (ctb=2d)
gpg: keydb_search failed: invalid packet
gpg: encrypted with RSA key, ID ********
gpg: decryption failed: secret key not available

The 'ctb=2d' means that GnuPG has detected an extra '-' (0x2d) character,
except that this bug occurs (seemingly) at random during batch operations when
there is no extra '-'. (Or, at least, other files generated with similar
parameters and functions do not cause the 'invalid packet' error message to
appear.)

https://bugs.g10code.com/gnupg/issue1179
http://bugs.g10code.com/gnupg/issue997