Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 268... Línea 268...
268
        // Avoid passing null values to base64_encode.
268
        // Avoid passing null values to base64_encode.
269
        if (!$ok) {
269
        if (!$ok) {
270
            throw new OAuthException("OpenSSL unable to sign data");
270
            throw new OAuthException("OpenSSL unable to sign data");
271
        }
271
        }
Línea 272... Línea -...
272
 
-
 
273
        // TODO: Remove this block once PHP 8.0 becomes required.
-
 
274
        if (PHP_MAJOR_VERSION < 8) {
-
 
275
            // Release the key resource
-
 
276
            openssl_free_key($privatekeyid);
-
 
277
        }
-
 
278
 
272
 
279
        return base64_encode($signature);
273
        return base64_encode($signature);
Línea 280... Línea 274...
280
    }
274
    }
281
 
275
 
Línea 291... Línea 285...
291
        $publickeyid = openssl_get_publickey($cert);
285
        $publickeyid = openssl_get_publickey($cert);
Línea 292... Línea 286...
292
 
286
 
293
        // Check the computed signature against the one passed in the query
287
        // Check the computed signature against the one passed in the query
Línea 294... Línea -...
294
        $ok = openssl_verify($base_string, $decoded_sig, $publickeyid);
-
 
295
 
-
 
296
        // TODO: Remove this block once PHP 8.0 becomes required.
-
 
297
        if (PHP_MAJOR_VERSION < 8) {
-
 
298
            // Release the key resource
-
 
299
            openssl_free_key($publickeyid);
-
 
300
        }
288
        $ok = openssl_verify($base_string, $decoded_sig, $publickeyid);
301
 
289
 
302
        return $ok == 1;
290
        return $ok == 1;
Línea 303... Línea 291...
303
    }
291
    }