]> the.earth.li Git - onak.git/blobdiff - stripkey.c
Fix compilation with later versions of Nettle
[onak.git] / stripkey.c
index 414c1633c939be58677370755098faa7d7d5110b..af1578472a174aa5356ba287e9efdd50b2f70f6d 100644 (file)
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
-#include <getopt.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
 
-#include "armor.h"
 #include "charfuncs.h"
 #include "cleankey.h"
-#include "keydb.h"
 #include "keyid.h"
-#include "keyindex.h"
 #include "keystructs.h"
-#include "log.h"
 #include "mem.h"
-#include "merge.h"
-#include "onak-conf.h"
 #include "parsekey.h"
-#include "photoid.h"
 #include "decodekey.h"
 
 int main(int argc, char** argv) {
@@ -60,10 +49,11 @@ int main(int argc, char** argv) {
   parse_keys( packets, &keys );
   free_packet_list(packets);
   packets = NULL;
-  cleankeys( keys );
+  cleankeys(NULL, &keys, ONAK_CLEAN_ALL);
   /* Iterate over the keys... */
   for( key = keys; key; key = key->next ) {
-    uint64_t keyid = get_keyid( key );
+    uint64_t keyid;
+    get_keyid( key, &keyid );
     for( uid = key->uids; uid; uid = uid->next ) {
       REPEATTHISUID: 
       for( sig = uid->sigs, prevsig = NULL; 
@@ -83,8 +73,8 @@ int main(int argc, char** argv) {
         }
       }
     }
-    flatten_publickey( key, &packets, &list_end );
   }
+  flatten_publickey( keys, &packets, &list_end );
   write_openpgp_stream( stdout_putchar, NULL, packets );
   return 0;
 }