All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <method@manicmethod.com>
To: William Roberts <bill.c.roberts@gmail.com>
Cc: Robert Craig <robertpcraig@gmail.com>,
	selinux@tycho.nsa.gov, Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: signature clause in mac_permisions
Date: Tue, 18 Sep 2012 13:01:24 -0400	[thread overview]
Message-ID: <5058A8E4.6080105@manicmethod.com> (raw)
In-Reply-To: <CAFftDdotOM8pyZVJ_g0_56L3382uTvq+JpGsqzioJc+MRdXDKw@mail.gmail.com>

If you want to go straight from cert to hex encoding without having to 
sign an app (i.e., you are generating certs and policies at the same 
time) you can use this:

$openssl x509 -inform PEM -in <certname>.x509.pem -outform DER

Script to encode:

#!/usr/bin/env python

import sys
content = sys.stdin.read().strip()
foo = content.encode("hex")
sys.stdout.write(foo)


The script to encode has to be very careful about padding or null 
terminating, hence why I couldn't just use some random command line tool.

William Roberts wrote:
> I should have RTFM, it is right on the wiki under install time mac
> http://selinuxproject.org/page/SEAndroid
>
>
>
> On Mon, Sep 17, 2012 at 4:22 PM, Robert Craig <robertpcraig@gmail.com
> <mailto:robertpcraig@gmail.com>> wrote:
>
>     Just run the setool host tool. To build just 'make setool' and then
>     to run just 'setool'. The help usage statement will guide you.
>
>
>     On Mon, Sep 17, 2012 at 2:34 PM, William Roberts
>     <bill.c.roberts@gmail.com <mailto:bill.c.roberts@gmail.com>> wrote:
>
>         How did you guys generate the hex encoded x509 string for a
>         signature clause in mac_permissions.xml?
>
>         Did you use the Android "dumpkey.jar"?
>
>         I have the signed apk's, the keystore used to sign them, .pem
>         files which have all the pub keys in them and a p12 and p8 file.
>
>         Which one should I use?
>
>         --
>         Respectfully,
>
>         William C Roberts
>
>
>
>
>
>
> --
> Respectfully,
>
> William C Roberts
>
>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2012-09-18 17:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17 18:34 signature clause in mac_permisions William Roberts
2012-09-17 23:22 ` Robert Craig
2012-09-17 23:59   ` William Roberts
2012-09-18 17:01     ` Joshua Brindle [this message]
2012-09-18 17:48       ` William Roberts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5058A8E4.6080105@manicmethod.com \
    --to=method@manicmethod.com \
    --cc=bill.c.roberts@gmail.com \
    --cc=robertpcraig@gmail.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.