Changeset 4431


Ignore:
Timestamp:
05/14/08 11:14:50 (5 years ago)
Author:
thomas
Message:

opkg: * Add opkg-key utility

  • Move update-alternatives to utils directory
  • Update opkg_verify_file function to import keys from /etc/opkg
Location:
trunk/src/target/opkg
Files:
3 added
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/target/opkg/Makefile.am

    r4405 r4431  
    1 SUBDIRS = libbb libopkg src tests 
     1SUBDIRS = libbb libopkg src tests utils 
    22 
    33HOST_CPU=@host_cpu@ 
     
    1010 
    1111 
    12 bin_SCRIPTS = update-alternatives 
    1312 
    1413interceptdir = $(datadir)/opkg/intercept 
  • trunk/src/target/opkg/configure.ac

    r4418 r4431  
    138138    src/Makefile 
    139139    libbb/Makefile 
     140    utils/Makefile 
    140141    libopkg.pc 
    141142    ) 
  • trunk/src/target/opkg/libopkg/opkg_download.c

    r4412 r4431  
    234234    int status = -1; 
    235235    gpgme_ctx_t ctx; 
    236     gpgme_data_t sig, text; 
     236    gpgme_data_t sig, text, key; 
    237237    gpgme_error_t err = -1; 
    238238    gpgme_verify_result_t result; 
    239239    gpgme_signature_t s; 
     240    char *trusted_path = NULL; 
    240241     
    241242    err = gpgme_new (&ctx); 
     
    244245        return -1; 
    245246 
     247    sprintf_alloc(&trusted_path, "%s/%s", conf->offline_root, "/etc/opkg/trusted.gpg"); 
     248    err = gpgme_data_new_from_file (&key, trusted_path, 1);  
     249    free (trusted_path); 
     250    if (err) 
     251    { 
     252      return -1; 
     253    } 
     254    err = gpgme_op_import (ctx, key); 
     255    if (err) 
     256    { 
     257      gpgme_data_release (key); 
     258      return -1; 
     259    } 
     260    gpgme_data_release (key); 
     261 
    246262    err = gpgme_data_new_from_file (&sig, sig_file, 1);  
    247263    if (err) 
    248         return -1; 
     264    { 
     265        gpgme_release (ctx); 
     266        return -1; 
     267    } 
    249268 
    250269    err = gpgme_data_new_from_file (&text, text_file, 1);  
    251270    if (err) 
    252         return -1; 
     271    { 
     272        gpgme_data_release (sig); 
     273        gpgme_release (ctx); 
     274        return -1; 
     275    } 
    253276 
    254277    err = gpgme_op_verify (ctx, sig, text, NULL); 
    255     if (err) 
    256         return -1; 
    257278 
    258279    result = gpgme_op_verify_result (ctx); 
     
    269290        s = s->next; 
    270291    } 
     292 
    271293 
    272294    gpgme_data_release (sig); 
  • trunk/src/target/opkg/src/Makefile.am

    r4428 r4431  
    11AM_CFLAGS = -I${top_srcdir}/libopkg ${ALL_CFLAGS} 
    2 bin_PROGRAMS = opkg-cl 
     2bin_PROGRAMS = opkg-cl opkg-key 
    33 
    44opkg_cl_SOURCES = opkg-frontend.c 
     
    66                $(top_builddir)/libbb/libbb.la  
    77 
    8  
     8opkg_key_SOURCES = opkg-key.c 
     9opkg_key_LDADD = $(GPGME_LIBS)  
Note: See TracChangeset for help on using the changeset viewer.