|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T a
Length: 9181 (0x23dd)
Types: TextFile
Names: »af-dec.py«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z«
└─⟦de7628f85⟧
└─⟦this⟧ »isode-6.0/dsap/x500as/af-dec.py«
-- af-dec.py - manually-augmented AuthenticationFramework module
-- $Header: /f/osi/dsap/x500as/RCS/af-dec.py,v 7.0 89/11/23 21:50:01 mrose Rel $
--
--
-- $Log: af-dec.py,v $
-- Revision 7.0 89/11/23 21:50:01 mrose
-- Release 6.0
--
--
-- NOTICE
--
-- Acquisition, use, and distribution of this module and related
-- materials are subject to the restrictions of a license agreement.
-- Consult the Preface in the User's Manual for the full terms of
-- this agreement.
--
--
AF
{
joint-iso-ccitt
ds(5)
modules(1)
authenticationFramework(7)
}
DEFINITIONS ::=
%{
#include <stdio.h>
#include "quipu/util.h"
#include "quipu/name.h"
#include "quipu/bind.h"
#define decode_UNIV_UTCTime parse_UNIV_UTCTime
extern LLog * log_dsap;
%}
PREFIXES encode decode print
BEGIN
-- EXPORTS
-- AlgorithmIdentifier ,
-- Certificate ,
-- Certificates ,
-- CertificationPath;
IMPORTS
Name
FROM IF
{
joint-iso-ccitt
ds(5)
modules(1)
informationFramework(1)
};
DECODER decode
Version [[P int *]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("At decode Version (AF)"));
%}
INTEGER [[i *parm]]
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode Version (AF)"));
%}
CertificateSerialNumber [[P int *]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode CertificateSerialNumber (AF)"));
%}
INTEGER [[i *parm]]
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode CertificateSerialNumber (AF)"));
%}
Validity [[P struct validity *]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode Validity (AF)"));
%}
SEQUENCE
{
notBefore
UTCTime [[s parm->not_before]],
notAfter
UTCTime [[s parm->not_after]]
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode Validity (AF)"));
%}
AlgorithmIdentifier [[P struct alg_id *]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode AlgorithmIdentifier (AF)"));
parm->p_type = ALG_PARM_ABSENT;
parm->un.numeric = 0;
%}
SEQUENCE
{
algorithm
OBJECT IDENTIFIER [[O parm->algorithm]],
parameters
ANY [[a parm->asn]]
%{
parm->p_type = ALG_PARM_UNKNOWN;
%}
OPTIONAL
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode AlgorithmIdentifier (AF)"));
%}
SubjectPublicKeyInfo [[P struct key_info *]]
%{
struct qbuf *qb;
int exponent;
%}
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode SubjectPublicKeyInfo (AF)"));
%}
SEQUENCE
{
algorithm
AlgorithmIdentifier [[p &(parm->alg)]],
subjectPublicKey
CHOICE {
BIT STRING [[x parm->value $ parm->n_bits]],
SEQUENCE {
[UNIVERSAL 2] IMPLICIT OCTET STRING
[[q qb]]
%{
parm->value = qb2str(qb);
parm->n_bits = qb->qb_len*8;
/* Really should total up pieces ... */
qb_free(qb);
%},
INTEGER [[i exponent]]
}
}
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode SubjectPublicKeyInfo (AF)"));
%}
CertificateToSign [[P struct certificate **]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode CertificateToSign (AF)"));
(*parm)->version = 0;
%}
SEQUENCE
{
version
[0] Version [[p &((*parm)->version)]]
OPTIONAL ,
serialNumber
CertificateSerialNumber [[p &((*parm)->serial)]],
signature
AlgorithmIdentifier [[p &((*parm)->alg)]],
issuer
Name [[p &((*parm)->issuer)]] ,
validity
Validity [[p &((*parm)->valid)]],
subject
Name [[p &((*parm)->subject)]] ,
subjectPublicKeyInfo
SubjectPublicKeyInfo [[p &((*parm)->key)]]
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode CertificateToSign (AF)"));
%}
Certificate [[P struct certificate **]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode Certificate (AF)"));
(*parm) = (struct certificate *) calloc(1, sizeof(struct certificate));
%}
SEQUENCE
{
CertificateToSign [[p parm]],
AlgorithmIdentifier [[p &((*parm)->sig.alg)]],
BIT STRING [[x (*parm)->sig.encrypted $ (*parm)->sig.n_bits]]
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode Certificate (AF)"));
%}
CrossCertificates [[P struct certificate_list **]]
::=
SET OF
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode CrossCertificates (AF)"));
(*parm) = (struct certificate_list *)
calloc(1, sizeof(struct certificate_list));
(*parm)->reverse = (struct certificate *) 0;
(*parm)->next = (struct certificate_list *) 0;
(*parm)->superior = (struct certificate_list *) 0;
%}
Certificate [[p &((*parm)->cert)]]
%{
parm = &((*parm)->next);
DLOG(log_dsap, LLOG_TRACE, ("Done decode CrossCertificates (AF)"));
%}
ForwardCertificationPath [[P struct certificate_list **]]
::=
SEQUENCE OF
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode ForwardCertificationPath (AF)"));
%}
CrossCertificates [[p parm]]
%{
parm = &((*parm)->superior);
DLOG(log_dsap, LLOG_TRACE, ("Done decode ForwardCertificationPath (AF)"));
%}
Certificates [[P struct certificate_list **]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode Certificates (AF)"));
(*parm) = (struct certificate_list *)
calloc(1, sizeof(struct certificate_list));
(*parm)->reverse = (struct certificate *) 0;
(*parm)->next = (struct certificate_list *) 0;
(*parm)->superior = (struct certificate_list *) 0;
%}
SEQUENCE
{
certificate
Certificate [[p &((*parm)->cert)]],
certificationPath
ForwardCertificationPath [[p &((*parm)->superior)]]
OPTIONAL
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode Certificates (AF)"));
%}
CertificatePair [[P struct certificate_list **]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode CertificatePair (AF)"));
(*parm) = (struct certificate_list *)
calloc(1, sizeof(struct certificate_list));
(*parm)->cert = (struct certificate *) 0;
(*parm)->reverse = (struct certificate *) 0;
(*parm)->next = (struct certificate_list *) 0;
(*parm)->superior = (struct certificate_list *) 0;
%}
SEQUENCE
{
forward
[0] Certificate [[p &((*parm)->cert)]]
OPTIONAL ,
reverse
[1] Certificate [[p &((*parm)->reverse)]]
OPTIONAL
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode CertificatePair (AF)"));
%}
CertificationPath [[P struct certificate_list **]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode CertificationPath (AF)"));
(*parm) = (struct certificate_list *)
calloc(1, sizeof(struct certificate_list));
(*parm)->next = (struct certificate_list *) 0;
(*parm)->superior = (struct certificate_list *) 0;
(*parm)->reverse = (struct certificate *) 0;
%}
SEQUENCE
{
userCertificate
Certificate [[p &((*parm)->cert)]],
theCACertificates
SEQUENCE OF
CertificatePair [[p &((*parm)->superior)]]
OPTIONAL
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode CertificationPath (AF)"));
%}
RevokedCertificateToSign [[P struct revoked_certificate **]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode RevokedCertificateToSign (AF)"));
(*parm) = (struct revoked_certificate *)
calloc(1, sizeof(struct revoked_certificate));
%}
SEQUENCE
{
signature
AlgorithmIdentifier [[p &((*parm)->alg)]],
issuer
Name [[p &((*parm)->subject)]],
subject
CertificateSerialNumber [[p &((*parm)->serial)]],
revokationDate
UTCTime [[s (*parm)->revocation_date]]
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode RevokedCertificateToSign (AF)"));
%}
RevokedCertificates [[P struct revocation_list **]]
%{
struct revoked_certificate **tmp;
%}
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode RevokedCertificates (AF)"));
tmp = (struct revoked_certificate **) &((*parm)->revoked);
%}
SEQUENCE
{
SEQUENCE OF
RevokedCertificateToSign [[p tmp]]
%{
tmp = &((*tmp)->next);
%},
AlgorithmIdentifier [[p &((*parm)->sig2.alg)]],
BIT STRING [[x (*parm)->sig2.encrypted $ (*parm)->sig2.n_bits]]
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode RevokedCertificates (AF)"));
%}
CertificateListToSign [[P struct revocation_list **]]
%{
%}
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode CertificateListToSign (AF)"));
%}
SEQUENCE
{
signature
AlgorithmIdentifier [[p &((*parm)->alg)]],
issuer
Name [[p &((*parm)->issuer)]],
lastUpdate
UTCTime [[s (*parm)->last_update]],
revokedCertificates
RevokedCertificates [[p parm]]
OPTIONAL
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode CertificateListToSign (AF)"));
%}
CertificateList [[P struct revocation_list **]]
::=
%{
DLOG(log_dsap, LLOG_TRACE, ("About to decode CertificateList (AF)"));
(*parm) = (struct revocation_list *)
calloc(1, sizeof(struct revocation_list));
%}
SEQUENCE
{
CertificateListToSign [[p parm]],
AlgorithmIdentifier [[p &((*parm)->sig.alg)]],
BIT STRING [[x (*parm)->sig.encrypted $ (*parm)->sig.n_bits]]
}
%{
DLOG(log_dsap, LLOG_TRACE, ("Done decode CertificateList (AF)"));
%}
END