Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 154... Línea 154...
154
    // Avoid passing null values to base64_encode.
154
    // Avoid passing null values to base64_encode.
155
    if (!$ok) {
155
    if (!$ok) {
156
      throw new OAuthException("OpenSSL unable to sign data");
156
      throw new OAuthException("OpenSSL unable to sign data");
157
    }
157
    }
Línea 158... Línea -...
158
 
-
 
159
    // TODO: Remove this block once PHP 8.0 becomes required.
-
 
160
    if (PHP_MAJOR_VERSION < 8) {
-
 
161
      // Release the key resource
-
 
162
      openssl_free_key($privatekeyid);
-
 
163
    }
-
 
164
 
158
 
165
    return base64_encode($signature);
159
    return base64_encode($signature);
Línea 166... Línea 160...
166
  }
160
  }
167
 
161
 
Línea 177... Línea 171...
177
    $publickeyid = openssl_get_publickey($cert);
171
    $publickeyid = openssl_get_publickey($cert);
Línea 178... Línea 172...
178
 
172
 
179
    // Check the computed signature against the one passed in the query
173
    // Check the computed signature against the one passed in the query
Línea 180... Línea -...
180
    $ok = openssl_verify($base_string, $decoded_sig, $publickeyid);
-
 
181
 
-
 
182
    // TODO: Remove this block once PHP 8.0 becomes required.
-
 
183
    if (PHP_MAJOR_VERSION < 8) {
-
 
184
      // Release the key resource
-
 
185
      openssl_free_key($publickeyid);
-
 
186
    }
174
    $ok = openssl_verify($base_string, $decoded_sig, $publickeyid);
187
 
175
 
188
    return $ok == 1;
176
    return $ok == 1;
Línea 189... Línea 177...
189
  }
177
  }