- applied patch from andreas, which allows certificate listing via stroke

This commit is contained in:
Martin Willi
2006-05-19 06:44:08 +00:00
parent 3e61d63a3a
commit 86a7937b45
17 changed files with 343 additions and 117 deletions
+51 -23
View File
@@ -40,39 +40,58 @@
* TODO: We may move them in asn1 sometime...
*/
u_int8_t md2_oid[] = {
0x30,0x20,0x30,0x0c,0x06,0x08,0x2a,0x86,
0x48,0x86,0xf7,0x0d,0x02,0x02,0x05,0x00,
0x04,0x10
const u_int8_t md2_oid[] = {
0x30,0x20,
0x30,0x0c,
0x06,0x08,
0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x02,
0x05,0x00,
0x04,0x10
};
u_int8_t md5_oid[] = {
0x30,0x20,0x30,0x0c,0x06,0x08,0x2a,0x86,
0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,
0x04,0x10
const u_int8_t md5_oid[] = {
0x30,0x20,
0x30,0x0c,
0x06,0x08,
0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,
0x05,0x00,
0x04,0x10
};
u_int8_t sha1_oid[] = {
0x30,0x21,0x30,0x09,0x06,0x05,0x2b,0x0e,
0x03,0x02,0x1a,0x05,0x00,0x04,0x14
const u_int8_t sha1_oid[] = {
0x30,0x21,
0x30,0x09,
0x06,0x05,
0x2b,0x0e,0x03,0x02,0x1a,
0x05,0x00,
0x04,0x14
};
u_int8_t sha256_oid[] = {
0x30,0x31,0x30,0x0d,0x06,0x09,0x60,0x86,
0x48,0x01,0x65,0x03,0x04,0x02,0x01,0x05,
0x00,0x04,0x20
const u_int8_t sha256_oid[] = {
0x30,0x31,
0x30,0x0d,
0x06,0x09,
0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,
0x05,0x00,
0x04,0x20
};
u_int8_t sha384_oid[] = {
0x30,0x41,0x30,0x0d,0x06,0x09,0x60,0x86,
0x48,0x01,0x65,0x03,0x04,0x02,0x02,0x05,
0x00,0x04,0x30
const u_int8_t sha384_oid[] = {
0x30,0x41,
0x30,0x0d,
0x06,0x09,
0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,
0x05,0x00,
0x04,0x30
};
u_int8_t sha512_oid[] = {
0x30,0x51,0x30,0x0d,0x06,0x09,0x60,0x86,
0x48,0x01,0x65,0x03,0x04,0x02,0x03,0x05,
0x00,0x04,0x40
const u_int8_t sha512_oid[] = {
0x30,0x51,
0x30,0x0d,
0x06,0x09,
0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,
0x05,0x00,
0x04,0x40
};
/* ASN.1 definition public key */
@@ -337,6 +356,14 @@ static mpz_t *get_modulus(private_rsa_public_key_t *this)
return &this->n;
}
/**
* Implementation of rsa_public_key.get_keysize.
*/
static size_t get_keysize(private_rsa_public_key_t *this)
{
return this->k;
}
/**
* Implementation of rsa_public_key.clone.
*/
@@ -373,6 +400,7 @@ private_rsa_public_key_t *rsa_public_key_create_empty(void)
this->public.get_key = (status_t (*) (rsa_public_key_t*,chunk_t*))get_key;
this->public.save_key = (status_t (*) (rsa_public_key_t*,char*))save_key;
this->public.get_modulus = (mpz_t *(*) (rsa_public_key_t*))get_modulus;
this->public.get_keysize = (size_t (*) (rsa_public_key_t*))get_keysize;
this->public.clone = (rsa_public_key_t* (*) (rsa_public_key_t*))_clone;
this->public.destroy = (void (*) (rsa_public_key_t*))destroy;