OLD | NEW |
1 /* nsseq.c */ | 1 /* nsseq.c */ |
2 /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 * project 1999. | 3 * project 1999. |
4 */ | 4 */ |
5 /* ==================================================================== | 5 /* ==================================================================== |
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | 6 * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
11 * | 11 * |
12 * 1. Redistributions of source code must retain the above copyright | 12 * 1. Redistributions of source code must retain the above copyright |
13 * notice, this list of conditions and the following disclaimer. | 13 * notice, this list of conditions and the following disclaimer. |
14 * | 14 * |
15 * 2. Redistributions in binary form must reproduce the above copyright | 15 * 2. Redistributions in binary form must reproduce the above copyright |
16 * notice, this list of conditions and the following disclaimer in | 16 * notice, this list of conditions and the following disclaimer in |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 * Hudson (tjh@cryptsoft.com). | 55 * Hudson (tjh@cryptsoft.com). |
56 * | 56 * |
57 */ | 57 */ |
58 | 58 |
59 #include <stdio.h> | 59 #include <stdio.h> |
60 #include <stdlib.h> | 60 #include <stdlib.h> |
61 #include <openssl/asn1t.h> | 61 #include <openssl/asn1t.h> |
62 #include <openssl/x509.h> | 62 #include <openssl/x509.h> |
63 #include <openssl/objects.h> | 63 #include <openssl/objects.h> |
64 | 64 |
65 static int nsseq_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it) | 65 static int nsseq_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, |
| 66 » » » » » » » void *exarg) |
66 { | 67 { |
67 if(operation == ASN1_OP_NEW_POST) { | 68 if(operation == ASN1_OP_NEW_POST) { |
68 NETSCAPE_CERT_SEQUENCE *nsseq; | 69 NETSCAPE_CERT_SEQUENCE *nsseq; |
69 nsseq = (NETSCAPE_CERT_SEQUENCE *)*pval; | 70 nsseq = (NETSCAPE_CERT_SEQUENCE *)*pval; |
70 nsseq->type = OBJ_nid2obj(NID_netscape_cert_sequence); | 71 nsseq->type = OBJ_nid2obj(NID_netscape_cert_sequence); |
71 } | 72 } |
72 return 1; | 73 return 1; |
73 } | 74 } |
74 | 75 |
75 /* Netscape certificate sequence structure */ | 76 /* Netscape certificate sequence structure */ |
76 | 77 |
77 ASN1_SEQUENCE_cb(NETSCAPE_CERT_SEQUENCE, nsseq_cb) = { | 78 ASN1_SEQUENCE_cb(NETSCAPE_CERT_SEQUENCE, nsseq_cb) = { |
78 ASN1_SIMPLE(NETSCAPE_CERT_SEQUENCE, type, ASN1_OBJECT), | 79 ASN1_SIMPLE(NETSCAPE_CERT_SEQUENCE, type, ASN1_OBJECT), |
79 ASN1_EXP_SEQUENCE_OF_OPT(NETSCAPE_CERT_SEQUENCE, certs, X509, 0) | 80 ASN1_EXP_SEQUENCE_OF_OPT(NETSCAPE_CERT_SEQUENCE, certs, X509, 0) |
80 } ASN1_SEQUENCE_END_cb(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE) | 81 } ASN1_SEQUENCE_END_cb(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE) |
81 | 82 |
82 IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) | 83 IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) |
OLD | NEW |