aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
Diffstat (limited to 'asn1')
-rw-r--r--asn1/pkcs1/pkcs1.cnf3
-rw-r--r--asn1/x509af/packet-x509af-template.c1
-rw-r--r--asn1/x509af/x509af.cnf26
3 files changed, 30 insertions, 0 deletions
diff --git a/asn1/pkcs1/pkcs1.cnf b/asn1/pkcs1/pkcs1.cnf
index 8990fe7e79..a332955f78 100644
--- a/asn1/pkcs1/pkcs1.cnf
+++ b/asn1/pkcs1/pkcs1.cnf
@@ -31,6 +31,9 @@ ECPoint
DSA-Sig-Value
ECDSA-Sig-Value
+#.TYPE_ATTR
+RSAPublicKey/modulus TYPE = FT_BYTES DISPLAY = BASE_NONE
+
#.END
diff --git a/asn1/x509af/packet-x509af-template.c b/asn1/x509af/packet-x509af-template.c
index c6941421d2..5ce49b3312 100644
--- a/asn1/x509af/packet-x509af-template.c
+++ b/asn1/x509af/packet-x509af-template.c
@@ -33,6 +33,7 @@
#include "packet-x509if.h"
#include "packet-x509sat.h"
#include "packet-ldap.h"
+#include "packet-pkcs1.h"
#if defined(HAVE_LIBGNUTLS)
#include <gnutls/gnutls.h>
#endif
diff --git a/asn1/x509af/x509af.cnf b/asn1/x509af/x509af.cnf
index 5c98d6dbaf..8c299cef6d 100644
--- a/asn1/x509af/x509af.cnf
+++ b/asn1/x509af/x509af.cnf
@@ -87,6 +87,32 @@ CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate
x509af_export_publickey(tvb, actx, orig_offset, offset - orig_offset);
#.END
+#.FN_BODY SubjectPublicKeyInfo/subjectPublicKey
+ tvbuff_t *bs_tvb;
+# proto_tree *subtree;
+
+ dissect_ber_bitstring(FALSE, actx, NULL, tvb, offset,
+ NULL, -1, -1, &bs_tvb);
+
+ /* See RFC 3279 for possible subjectPublicKey values given an Algorithm ID.
+ * The contents of subjectPublicKey are always explicitly tagged. */
+ if (!strcmp(algorithm_id, "1.2.840.113549.1.1.1")) { /* id-rsa */
+ offset += dissect_pkcs1_RSAPublicKey(FALSE, bs_tvb, 0, actx, tree, hf_index);
+
+# TODO: PKCS#1 only defines RSA; DH and DSA are from PKIX1Algorithms2008
+# } else if (!strcmp(algorithm_id, "1.2.840.10040.4.1")) { /* id-dsa */
+# subtree = proto_item_add_subtree(actx->created_item, ett_subjectpublickey);
+# offset += dissect_DSAPublicKey(FALSE, bs_tvb, 0, actx, subtree, hf_dsa_y);
+#
+# } else if (!strcmp(algorithm_id, "1.2.840.10046.2.1")) { /* dhpublicnumber */
+# subtree = proto_item_add_subtree(actx->created_item, ett_subjectpublickey);
+# offset += dissect_DHPublicKey(FALSE, bs_tvb, 0, actx, subtree, hf_dh_y);
+#
+ } else {
+ offset = dissect_ber_bitstring(FALSE, actx, tree, tvb, offset,
+ NULL, hf_index, -1, NULL);
+ }
+
#.FN_PARS Extension/extnId
FN_VARIANT = _str HF_INDEX = hf_x509af_extension_id VAL_PTR = &actx->external.direct_reference