| OLD | NEW |
| 1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
| 2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 4 #include "secdig.h" | 4 #include "secdig.h" |
| 5 | 5 |
| 6 #include "secoid.h" | 6 #include "secoid.h" |
| 7 #include "secasn1.h" | 7 #include "secasn1.h" |
| 8 #include "secerr.h" | 8 #include "secerr.h" |
| 9 | 9 |
| 10 /* | 10 /* |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * and encode). I think that is all anybody ever wants to do anyway. | 22 * and encode). I think that is all anybody ever wants to do anyway. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 SECItem * | 25 SECItem * |
| 26 SGN_EncodeDigestInfo(PLArenaPool *poolp, SECItem *dest, SGNDigestInfo *diginfo) | 26 SGN_EncodeDigestInfo(PLArenaPool *poolp, SECItem *dest, SGNDigestInfo *diginfo) |
| 27 { | 27 { |
| 28 return SEC_ASN1EncodeItem (poolp, dest, diginfo, sgn_DigestInfoTemplate); | 28 return SEC_ASN1EncodeItem (poolp, dest, diginfo, sgn_DigestInfoTemplate); |
| 29 } | 29 } |
| 30 | 30 |
| 31 SGNDigestInfo * | 31 SGNDigestInfo * |
| 32 SGN_CreateDigestInfo(SECOidTag algorithm, unsigned char *sig, unsigned len) | 32 SGN_CreateDigestInfo(SECOidTag algorithm, const unsigned char *sig, |
| 33 unsigned len) |
| 33 { | 34 { |
| 34 SGNDigestInfo *di; | 35 SGNDigestInfo *di; |
| 35 SECStatus rv; | 36 SECStatus rv; |
| 36 PLArenaPool *arena; | 37 PLArenaPool *arena; |
| 37 SECItem *null_param; | 38 SECItem *null_param; |
| 38 SECItem dummy_value; | 39 SECItem dummy_value; |
| 39 | 40 |
| 40 switch (algorithm) { | 41 switch (algorithm) { |
| 41 case SEC_OID_MD2: | 42 case SEC_OID_MD2: |
| 42 case SEC_OID_MD5: | 43 case SEC_OID_MD5: |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 SECComparison rv; | 172 SECComparison rv; |
| 172 | 173 |
| 173 /* Check signature algorithm's */ | 174 /* Check signature algorithm's */ |
| 174 rv = SECOID_CompareAlgorithmID(&a->digestAlgorithm, &b->digestAlgorithm); | 175 rv = SECOID_CompareAlgorithmID(&a->digestAlgorithm, &b->digestAlgorithm); |
| 175 if (rv) return rv; | 176 if (rv) return rv; |
| 176 | 177 |
| 177 /* Compare signature block length's */ | 178 /* Compare signature block length's */ |
| 178 rv = SECITEM_CompareItem(&a->digest, &b->digest); | 179 rv = SECITEM_CompareItem(&a->digest, &b->digest); |
| 179 return rv; | 180 return rv; |
| 180 } | 181 } |
| OLD | NEW |