X-Git-Url: http://the.earth.li/gitweb/?a=blobdiff_plain;f=stripkey.c;h=af1578472a174aa5356ba287e9efdd50b2f70f6d;hb=c981a80699901eb3d513a4cc9355574a69016037;hp=cefab42fe97479ce10e2856ce3b6857e36b4ee27;hpb=5e1b22d763640c4d7a09d07920403d8d491b4410;p=onak.git
diff --git a/stripkey.c b/stripkey.c
index cefab42..af15784 100644
--- a/stripkey.c
+++ b/stripkey.c
@@ -13,30 +13,19 @@
* 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 .
*/
-#include
+#include
#include
#include
-#include
-#include
-#include
-#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) {
@@ -47,7 +36,6 @@ int main(int argc, char** argv) {
struct openpgp_signedpacket_list *uid = NULL;
struct openpgp_packet_list *sig = NULL;
struct openpgp_packet_list *prevsig = NULL;
- int result = 0;
uint64_t my_key = 0;
if( argc > 1 )
@@ -57,14 +45,15 @@ int main(int argc, char** argv) {
/* strip each key of everything but its pubkey component, uids and
* selfsigs and revsigs on those selfsigs */
- result = read_openpgp_stream( stdin_getchar, NULL, &packets, 0 );
- result = parse_keys( packets, &keys );
+ read_openpgp_stream( stdin_getchar, NULL, &packets, 0 );
+ parse_keys( packets, &keys );
free_packet_list(packets);
packets = NULL;
- result = 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;
@@ -84,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;
}