pike.git
/
lib
/
modules
/
Crypto.pmod
/
DSA.pmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Crypto.pmod/DSA.pmod:300:
array sign = map(raw_sign(hash(message, h)), Standards.ASN1.Types.Integer); return Standards.ASN1.Types.Sequence(sign)->get_der(); } #define Object Standards.ASN1.Types.Object //! Verify PKCS-1 signature @[sign] of message @[message] using hash //! algorithm @[h]. int(0..1) pkcs_verify(string(8bit) message, .Hash h, string(8bit) sign) {
-
Object a = Standards.ASN1.Decode.
simple
_der_decode(sign);
+
Object a = Standards.ASN1.Decode.
secure
_der_decode(sign);
// The signature is the DER-encoded ASN.1 sequence Dss-Sig-Value // with the two integers r and s. See RFC 3279 section 2.2.2. if (!a || (a->type_name != "SEQUENCE") || (sizeof([array]a->elements) != 2) || (sizeof( ([array(object(Object))]a->elements)->type_name - ({ "INTEGER" })))) return 0;